Re: Optimizing channel lookups



On Jun 22, 12:08 am, Michael Schlenker <schl...@xxxxxxxxxxxxxxxx>
wrote:
Alexandre Ferrieux schrieb:





On Jun 21, 5:54 pm, Don Porter <d...@xxxxxxxx> wrote:
Alexandre Ferrieux wrote:
Question: Why the first lookup, with a static key ? Why not store a
pointer to the channel table as a field in the interp structure ?
Sounds relevant to Tcl Feature Request 1077194.

Hmmm.... although that mentions the "ekeko" proposal, it doesn't really
get into it. You might want to contact Miguel Sofer and ask if that
concept is spelled out anywhere.

Hmmm... a little bit more at:http://wiki.tcl.tk/ekeko

Do I interpret the picture well, in believing that the idea that the
interp struct is big and eclectic enough, so that all new additions
should only be through at least one indirection ? Are you serious
about this ? With a costly indirection like a hash table ? It's not
April Fool's day, right ?

It might be clever instead. Think about cpu cache usage. If you don't
need the whole structure all the time, you can improve performance with
such a strategy. Google for 'structure splitting'...

That's a general statement that doesn't apply here. The delta of cache
misses induced by an extra 4-byte value added to a 12-byte-long
structure present in just one instance (one per interp obviously), is
ridiculously small, especially when compared with all the cycles lost
in doing a hash lookup (which may itself induce cache misses).
Sometimes Googling is not enough...

-Alex

.