all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Length of obarray vectors
@ 2009-11-06 10:18 Nordlöw
  2009-11-06 10:20 ` Nordlöw
  0 siblings, 1 reply; 4+ messages in thread
From: Nordlöw @ 2009-11-06 10:18 UTC (permalink / raw
  To: help-gnu-emacs

What length should I use when I create a vector that will act as an
obarray?
My suggestion: The smallest prime larger than the number of symbols
that should be interned?
If this is correct why does (length obarray) give such a small number,
15

Thanks,
Nordlöw


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

* Re: Length of obarray vectors
  2009-11-06 10:18 Length of obarray vectors Nordlöw
@ 2009-11-06 10:20 ` Nordlöw
  2009-11-06 11:16   ` Pascal J. Bourguignon
  0 siblings, 1 reply; 4+ messages in thread
From: Nordlöw @ 2009-11-06 10:20 UTC (permalink / raw
  To: help-gnu-emacs

On Nov 6, 11:18 am, Nordlöw <per.nord...@gmail.com> wrote:
> What length should I use when I create a vector that will act as an
> obarray?
> My suggestion: The smallest prime larger than the number of symbols
> that should be interned?
> If this is correct why does (length obarray) give such a small number,
> 15
>
> Thanks,
> Nordlöw

It should be 1511, not 15.

Forgot one thing: My guess: Is it a trade-off of performance (big
length) and memory usage (small length)?

Thanks,
Nordlöw


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

* Re: Length of obarray vectors
  2009-11-06 10:20 ` Nordlöw
@ 2009-11-06 11:16   ` Pascal J. Bourguignon
  2009-11-06 12:03     ` Pascal J. Bourguignon
  0 siblings, 1 reply; 4+ messages in thread
From: Pascal J. Bourguignon @ 2009-11-06 11:16 UTC (permalink / raw
  To: help-gnu-emacs

Nordlöw <per.nordlow@gmail.com> writes:

> On Nov 6, 11:18 am, Nordlöw <per.nord...@gmail.com> wrote:
>> What length should I use when I create a vector that will act as an
>> obarray?
>> My suggestion: The smallest prime larger than the number of symbols
>> that should be interned?
>> If this is correct why does (length obarray) give such a small number,
>> 15
>>
>> Thanks,
>> Nordlöw
>
> It should be 1511, not 15.
>
> Forgot one thing: My guess: Is it a trade-off of performance (big
> length) and memory usage (small length)?

The reason is that obarrays are not arrays, but trees. You're watching
only the root of the tree.

-- 
__Pascal Bourguignon__


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

* Re: Length of obarray vectors
  2009-11-06 11:16   ` Pascal J. Bourguignon
@ 2009-11-06 12:03     ` Pascal J. Bourguignon
  0 siblings, 0 replies; 4+ messages in thread
From: Pascal J. Bourguignon @ 2009-11-06 12:03 UTC (permalink / raw
  To: help-gnu-emacs

pjb@informatimago.com (Pascal J. Bourguignon) writes:

> Nordlöw <per.nordlow@gmail.com> writes:
>
>> On Nov 6, 11:18 am, Nordlöw <per.nord...@gmail.com> wrote:
>>> What length should I use when I create a vector that will act as an
>>> obarray?
>>> My suggestion: The smallest prime larger than the number of symbols
>>> that should be interned?
>>> If this is correct why does (length obarray) give such a small number,
>>> 15
>>>
>>> Thanks,
>>> Nordlöw
>>
>> It should be 1511, not 15.
>>
>> Forgot one thing: My guess: Is it a trade-off of performance (big
>> length) and memory usage (small length)?
>
> The reason is that obarrays are not arrays, but trees. You're watching
> only the root of the tree.

Sorry, not trees, but kinds of hash-tables.

-- 
__Pascal Bourguignon__


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

end of thread, other threads:[~2009-11-06 12:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-06 10:18 Length of obarray vectors Nordlöw
2009-11-06 10:20 ` Nordlöw
2009-11-06 11:16   ` Pascal J. Bourguignon
2009-11-06 12:03     ` Pascal J. Bourguignon

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.