Update runtime files
This commit is contained in:
@ -45,14 +45,16 @@ full code is below):
|
||||
| Vim old | 5.018541 |
|
||||
| Python | 0.369598 |
|
||||
| Lua | 0.078817 |
|
||||
| LuaJit | 0.004245 |
|
||||
| Vim new | 0.073595 |
|
||||
|
||||
That looks very promising! It's just one example, but it shows how much
|
||||
we can gain, and also that Vim script can be faster than builtin
|
||||
interfaces.
|
||||
|
||||
In practice the script would not do something useless as counting but change
|
||||
the text. For example, reindent all the lines:
|
||||
LuaJit is much faster at Lua-only instructions. In practice the script would
|
||||
not do something useless as counting but change the text. For example,
|
||||
reindent all the lines:
|
||||
|
||||
``` vim
|
||||
let totallen = 0
|
||||
@ -64,13 +66,17 @@ the text. For example, reindent all the lines:
|
||||
|
||||
| how | time in sec |
|
||||
| --------| -------- |
|
||||
| Vim old | 0.853752 |
|
||||
| Python | 0.304584 |
|
||||
| Lua | 0.286573 |
|
||||
| Vim new | 0.190276 |
|
||||
| Vim old | 0.578598 |
|
||||
| Python | 0.152040 |
|
||||
| Lua | 0.164917 |
|
||||
| LuaJit | 0.128400 |
|
||||
| Vim new | 0.079692 |
|
||||
|
||||
[These times were measured on a different system by Dominique Pelle]
|
||||
|
||||
The differences are smaller, but Vim 9 script is clearly the fastest.
|
||||
Using LuaJIT gives 0.25, only a little bit faster than plain Lua.
|
||||
Using LuaJIT is only a little bit faster than plain Lua here, clearly the call
|
||||
back to the Vim code is costly.
|
||||
|
||||
How does Vim9 script work? The function is first compiled into a sequence of
|
||||
instructions. Each instruction has one or two parameters and a stack is
|
||||
|
Reference in New Issue
Block a user