gopher-lua
gopher-lua copied to clipboard
large memory usage when index is very large in LTable
- [x] GopherLua is a Lua5.1 implementation. You should be familiar with Lua programming language. Have you read Lua 5.1 reference manual carefully?
- [x] GopherLua is a Lua5.1 implementation. In Lua, to keep it simple, it is more important to remove functionalities rather than to add functionalities unlike other languages . If you are going to introduce some new cool functionalities into the GopherLua code base and the functionalities can be implemented by existing APIs, It should be implemented as a library.
Please answer the following before submitting your issue:
- What version of GopherLua are you using? : latest
- What version of Go are you using? : 1.13
- What operating system and processor architecture are you using? : osx
- What did you do? : write a value to a LTable with very large int index
- What did you expect to see? : the k,v should be stored in LTable.dic
- What did you see instead? : the k,v stored in LTable.array and fill many many LNil before the index
hi, i'v seen #117 , but i think it could be optimized just like the c-lua which ensure at least more than 50% usage of the array. so, i'v tried to implement this feature by learned from c-lua. i could make a pr to show what i'v done with this if you agree with me
hi~can you make a PR for that? I'm interested in your solution with this problem. @edolphin-ydf
@myrfy001 You can check it here https://github.com/edolphin-ydf/gopher-lua/tree/feature-table-setint with the 3 latest commits