[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should let symbols be interned?

From: Lennart Borgman (gmail)
Subject: Re: Should let symbols be interned?
Date: Mon, 22 Jan 2007 02:07:12 +0100
User-agent: Thunderbird (Windows/20061207)

Juanma Barranquero wrote:
On 1/22/07, Lennart Borgman (gmail) <address@hidden> wrote:

Thanks, but I did not mean on this level. On this level I would expect
it to be transparent to the user/programmer.

Please, explain that.


I tried to, but it seems like I am not clear enough. I know very little about the internals of Emacs, how the big obarray 'obarray is handled etc. Maybe it is hard to understand me because of this.

I believe however that it takes more time to insert a symbol in big obarray than in a small. But that depends on how the internal structure of an obarray looks and how it is handled. I assume it is some kind of tree structure.

'obarray is big. For 'obarray I would expect the most common access to be a search. Then the tree probably should be handled to optimize that. Balancing the tree is however a time costly operation (or maybe not?). Then perhaps it would make sense to have a small obarray for let variables. A bigger part of the access to this would be insert. Because it is small I believe insert can be handled in a shorter time than for 'obarray.

If this would outweigh the cost of doing a search in two obarrays for every variable symbol lookup is of course a question which can not be answered without knowledge of both the algorithms and typical use cases.

And thinking about it it looks to me that avoiding balancing the let symbols could achieve the same benefits without the cost of two lookups.

So this is all some rather dim thoughts about obarray lookup. Nothing very interesting if you do not know this part of Emacs and I don't.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]