unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Oliver Scholz <alkibiades@gmx.de>
Subject: Re: make-hash-table :size
Date: Sun, 29 Aug 2004 23:10:24 +0200	[thread overview]
Message-ID: <un00d6473.fsf@ID-87814.user.uni-berlin.de> (raw)
In-Reply-To: 87r7pqp32y.fsf@thalassa.informatimago.com

Pascal Bourguignon <spam@mouse-potato.com> writes:

> Oliver Scholz <alkibiades@gmx.de> writes:

[hash tables vs. alist for about a dozen elements.]
]
>> On my Emacs 21.3 on a 1.5 GHtz Athlon M-x test-run gives:
>> 
>> Function Name      Call Count  Elapsed Time  Average Time
>> =================  ==========  ============  ============
>> test-hash-access   10000       0.09          9e-006
>> test-alist-access  10000       0.04          4e-006
>
> Actually, I wrote a more complete benchmark before delivering my conclusion:

The completeness wouldn't explain the differences. I wouldn't trust
the actual times provided by the Emacs Lisp profiler, but the relative
times should be similar in both your benchmark and mine. Obviously, I
do not doubt your results, but I'd say that the differences request
explanation; and I am curious about their reason.

Actually I couldn't get your code to run:

> --------------------(hash-table.el)--------------------------------------
>
> ;; Let's include some CL stuff:
> (require 'cl)
>
> (defconstant internal-time-units-per-second 1000000
[...]

AFAICS `defconstant' doesn't exist, not even in cl.el.  But more
importantly:

[...]
> (defun alist-fetch (table test key)  (assoc key table :test test))

This `assoc' is not an Emacs function. There does exist an cl.el
function with such a parameter specification, but this one is called
`assoc*'.

I assume that you use some extended CL compatibility package other
than the one that comes with stock Emacs?  If that one overwrites
Emacs' `assoc' (which is implemented in C) with a function implemented
in Lisp, that could explain the profiling differences.


    Oliver
-- 
13 Fructidor an 212 de la Révolution
Liberté, Egalité, Fraternité!

  reply	other threads:[~2004-08-29 21:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-23 20:36 make-hash-table :size Joost Kremers
2004-08-23 20:45 ` Stefan Monnier
2004-08-23 21:00   ` Joost Kremers
2004-08-28 14:07 ` Kai Grossjohann
     [not found] ` <mailman.506.1093702372.1998.help-gnu-emacs@gnu.org>
2004-08-28 16:03   ` Pascal Bourguignon
2004-08-29 10:11     ` Oliver Scholz
2004-08-29 11:59       ` Pascal Bourguignon
2004-08-29 21:10         ` Oliver Scholz [this message]
2004-08-29 21:44           ` Oliver Scholz
2004-08-29 21:48             ` Oliver Scholz
2004-08-30  1:25               ` Pascal Bourguignon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=un00d6473.fsf@ID-87814.user.uni-berlin.de \
    --to=alkibiades@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).