> The current implementation of find_lex (by_name) is suboptimal. A linear > scan over the list of lexical names is performed > (s. sub.c:lexicals_get_position()). > > A better way would be to provide a list of lexicals plus a name hash, > where hash values are indices into the list.
What would be a better way depends on a number of elements on a list. If the number is small I don't think that a hash search + an access of a list element will beat a list scanning. And if each lexical scope has its own list (doesn't it?) a usual number of elements on a list won't exceed 10-20, I bet. In my opinion, if that's the case, it doesn't worth a needless waste of memory.