3 ms·
Lua naturally avoids hashing strings as much as possible. Short strings always have their hash precomputed and local variables are internalized. The default met
by scythe 4y ago
Lua naturally avoids hashing strings as much as possible. Short strings always have their hash precomputed and local variables are internalized. The default method for implementing variable scopes in dynamic languages just uses a lot of hash tables, but Lua cleverly avoids this:
https://github.com/lua/lua/blob/master/lobject.h#L549 https://github.com/lua/lua/blob/master/lobject.h#L549
https://github.com/lua/lua/blob/master/lstring.c#L185 https://github.com/lua/lua/blob/master/lstring.c#L185