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: Pushing the `gnus-range-*' functions down into the C layer Date: Sun, 12 Sep 2010 11:57:12 +0200 Message-ID: References: <8739ti68sz.fsf@lifelogs.com> <87pqwm1dsl.fsf@uwakimon.sk.tsukuba.ac.jp> <87iq2d4sd5.fsf@lifelogs.com> <8762yd4r7j.fsf@lifelogs.com> <8762ydr5br.fsf@lola.goethe.zz> <87d3sk1edr.fsf@uwakimon.sk.tsukuba.ac.jp> <87y6b8tfy3.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1284285452 7624 80.91.229.12 (12 Sep 2010 09:57:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 12 Sep 2010 09:57:32 +0000 (UTC) Cc: emacs-devel@gnu.org To: Wojciech Meyer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 12 11:57:31 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OujJQ-0002C2-2f for ged-emacs-devel@m.gmane.org; Sun, 12 Sep 2010 11:57:28 +0200 Original-Received: from localhost ([127.0.0.1]:53001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OujJP-0000fz-CM for ged-emacs-devel@m.gmane.org; Sun, 12 Sep 2010 05:57:27 -0400 Original-Received: from [140.186.70.92] (port=45178 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OujJF-0000ea-Dk for emacs-devel@gnu.org; Sun, 12 Sep 2010 05:57:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OujJD-0007Hg-Of for emacs-devel@gnu.org; Sun, 12 Sep 2010 05:57:17 -0400 Original-Received: from impaqm1.telefonica.net ([213.4.138.1]:17693) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OujJD-0007HW-FN for emacs-devel@gnu.org; Sun, 12 Sep 2010 05:57:15 -0400 Original-Received: from IMPmailhost3.adm.correo ([10.20.102.124]) by IMPaqm1.telefonica.net with bizsmtp id 5jF51f03X2h2L9m01lxEPB; Sun, 12 Sep 2010 11:57:14 +0200 Original-Received: from ceviche.home ([83.61.39.212]) by IMPmailhost3.adm.correo with BIZ IMP id 5lxC1f0044aeRwb1jlxCeR; Sun, 12 Sep 2010 11:57:13 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Original-Received: by ceviche.home (Postfix, from userid 20848) id 6D03F660D2; Sun, 12 Sep 2010 11:57:12 +0200 (CEST) In-Reply-To: <87y6b8tfy3.fsf@gmail.com> (Wojciech Meyer's message of "Sat, 11 Sep 2010 17:15:00 +0100") 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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130006 Archived-At: >> #define EQ(x, y) (XHASH (x) == XHASH (y)) Not only that, but also #define NILP(x) EQ (x, Qnil) So EQ is really used extensively in C and slowing it down is likely to make a perceptible difference. >> /* Return a perfect hash of the Lisp_Object representation. */ >> #define XHASH(a) (a) > this case I agree, it should not be called XHASH because that implies it > is used for structural equivalence, which is misleading. Also, hashing > object should behave like deep copying - follow pointers. Nothing says that hashing an object should behave like deep copying. That's why make-hash-table has a :test parameter which can be `eq' or `equal'. As for why we have XHASH: because there's another definition of it for when we use a union rather than an int for Lisp_Object: #define XHASH(a) ((a).i) -- Stefan