unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / 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

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).