From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: list-print-separator Date: Mon, 25 Apr 2011 09:41:39 -0300 Message-ID: References: <8762qr8x23.fsf@lifelogs.com> <87vcy7mbxq.fsf@lifelogs.com> <87hb9nglen.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1303735311 1721 80.91.229.12 (25 Apr 2011 12:41:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 25 Apr 2011 12:41:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 25 14:41:47 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QEL6p-0004qX-Il for ged-emacs-devel@m.gmane.org; Mon, 25 Apr 2011 14:41:47 +0200 Original-Received: from localhost ([::1]:59242 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEL6o-0007J2-Qq for ged-emacs-devel@m.gmane.org; Mon, 25 Apr 2011 08:41:46 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEL6m-0007IB-Ps for emacs-devel@gnu.org; Mon, 25 Apr 2011 08:41:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEL6l-0003Gs-Sc for emacs-devel@gnu.org; Mon, 25 Apr 2011 08:41:44 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:60387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEL6l-0003Go-RH for emacs-devel@gnu.org; Mon, 25 Apr 2011 08:41:43 -0400 Original-Received: from 121-249-126-200.fibertel.com.ar ([200.126.249.121]:34451 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QEL6l-0002fk-2J; Mon, 25 Apr 2011 08:41:43 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 70D9B6618A; Mon, 25 Apr 2011 09:41:39 -0300 (ART) In-Reply-To: <87hb9nglen.fsf@lifelogs.com> (Ted Zlatanov's message of "Sun, 24 Apr 2011 20:38:40 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138721 Archived-At: TZ> Since hashtables can get pretty big, it would be nice to have a TZ> separator between entries when they are printed. Could that be provided TZ> at the top level, e.g. TZ> (let ((hash-table-print-separator "\\\n")) TZ> (format "%S" my-hash-table)) SM> How 'bout changing `pp' instead? > I tried that (thanks for the pointer, I didn't know about it) and it was > MUCH slower than my patch. > Tested against a hashtable with 40K elements. My patch through `format' > took less than 3 seconds on a modern CPU with enough memory. `pp' took > a minute before I interrupted it. Hmm... I wouldn't try to compare the speed of `print' with that of `pp' since they do very different amounts of work and are implemented in languages whose performance is very different, but there's clearly room for improvement in pp's speed. > I intend to use it for large objects so the performance worries me. You could use an ad-hoc pp-like function, maybe? The way I see it, you typically either need "fast" or "pretty" but very rarely both. Stefan