Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Location array was reallocated for every instructions, which was very ineffective since we only need to reallocate the buffer either when yk location is set to NULL or when the number of bytecode instructions is greater than number of location in the yk location array. This was causing around 200x slowdown in benchmark test such as `verybig.lua`. The fix fetches the performance back by only reallocting when we need to. ---------------------------------------------------------- |Performance of benchmark numbers before and after the fix | ---------------------------------------------------------- | db.lua | 0.146 ± 0.003 | 0.127 ± 0.00 ---------------------------------------------------------- | fasta.lua | 3.798 ± 0.006 | 3.771 ± 0.002 ---------------------------------------------------------- | verybig.lua | 198.046 ± 1.06 | 0.638 ± 0.004 --------------------------------------------------------- |construct.lua| 4.999 ± 0.003 | 4.585 ± 0.003 -------------------------------------------------------- | gc.lua | 0.485 ± 0.009 | 0.467 ± 0.006
- Loading branch information