neovim/test/benchmark
Lewis Russell 3734519e3b feat(lua): add noref to deepcopy
Problem:

Currently `deepcopy` hashes every single tables it copies so it can be
reused. For tables of mostly unique items that are non recursive, this
hashing is unnecessarily expensive

Solution:

Port the `noref` argument from Vimscripts `deepcopy()`.

The below benchmark demonstrates the results for two extreme cases of
tables of different sizes. One table that uses the same table lots of
times and one with all unique tables.

| test                 | `noref=false` (ms) | `noref=true` (ms) |
| -------------------- | ------------------ | ----------------- |
| unique tables (50)   | 6.59               | 2.62              |
| shared tables (50)   | 3.24               | 6.40              |
| unique tables (2000) | 23381.48           | 2884.53           |
| shared tables (2000) | 3505.54            | 14038.80          |

The results are basically the inverse of each other where `noref` is
much more performance on tables with unique fields, and `not noref` is
more performant on tables that reuse fields.
2024-01-03 19:17:52 +00:00
..
autocmd_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
bench_regexp_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
deepcopy_spec.lua feat(lua): add noref to deepcopy 2024-01-03 19:17:52 +00:00
iter_spec.lua feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
preload.lua
treesitter_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00