Gnus development mailing list
 help / color / mirror / Atom feed
* Gnus hash-tables
@ 1997-02-23 10:48 Hrvoje Niksic
  1997-02-23 12:59 ` David Moore
  0 siblings, 1 reply; 2+ messages in thread
From: Hrvoje Niksic @ 1997-02-23 10:48 UTC (permalink / raw)


I wonder why doesn't Gnus use cl-style hash-tables provided by the CL
package?  For example, this function seems to make a hash-table as a
simple vector:

(defun gnus-make-hashtable (&optional hashsize)
  (make-vector (if hashsize (max (gnus-create-hash-size hashsize) 256) 256) 0))

I think it would be better to use `make-hash-table', as the XEmacs
internal hash-tables would be supported automatically (making Gnus
work much faster), and things would work as well in GNU Emacs.

make-hash-table: (&rest cl-keys)
  -- a compiled Lisp function.
  -- loads from "cl-extra".
Make an empty Common Lisp-style hash-table.
If :test is `eq', `eql', or `equal', this can use XEmacs built-in hash-tables.
[...]

Is there any specific reason not to use cl's hash-tables?

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Contrary to popular belief, Unix is user friendly.  
It just happens to be selective about who it makes friends with.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Gnus hash-tables
  1997-02-23 10:48 Gnus hash-tables Hrvoje Niksic
@ 1997-02-23 12:59 ` David Moore
  0 siblings, 0 replies; 2+ messages in thread
From: David Moore @ 1997-02-23 12:59 UTC (permalink / raw)


Hrvoje Niksic <hniksic@srce.hr> writes:

> I wonder why doesn't Gnus use cl-style hash-tables provided by the CL
> package?  For example, this function seems to make a hash-table as a
> simple vector:

> I think it would be better to use `make-hash-table', as the XEmacs
> internal hash-tables would be supported automatically (making Gnus
> work much faster), and things would work as well in GNU Emacs.

	The hash tables that Gnus uses are more like the internal
hashtables of XEmacs.  And are more like it in both flavors of emacs.
Gnus only hash's symbols into the table, and is therefore able to use
intern.  For the storage.  This is the same affect you'll have with
making an XEmacs hash-table using the `eq' spec.

> Is there any specific reason not to use cl's hash-tables?

	Yes, the intern approach also allows Gnus to locally let-bind
`obarray' to a hashtable and do a `read' to get the entry in it.  This
significantly speeds up processing of the active file from the nntp
server (and some other places as well).  Using non-"intern" style
hashtable would mean doing this common and somewhat expensive operation
multiple times.


-- 
David Moore <dmoore@ucsd.edu>       | Computer Systems Lab      __o
UCSD Dept. Computer Science - 0114  | Work: (619) 534-8604    _ \<,_
La Jolla, CA 92093-0114             | Fax:  (619) 534-1445   (_)/ (_)
<URL:http://oj.egbt.org/dmoore/>    | In a cloud bones of steel.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-02-23 12:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-23 10:48 Gnus hash-tables Hrvoje Niksic
1997-02-23 12:59 ` David Moore

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 NNTP newsgroup(s).