lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Work In Progress: About Lua Structures
From
: Ranier Vilela <ranier.vf@
...
>
Date
: Thu, 12 Nov 2020 19:07:21 -0300
Hi,
Work In Progress: About Lua structures
Sizeofs 64 bits (msvc 2019 64 bits):
Instruction: 4
TValue: 16
TString: 32
LClosure: 40
Proto: 128
I'm studying the structures of Lua, and one caught my attention: struct Proto
I think it's breaking the cache line in two.
After running the factorial test (
https://github.com/GitSparTV/lua-infographics/blob/main/lua-benchmark/benchmark.lua
)
An information caught my attention:
0.03s trap = L-> hookmask;
returning: / * trap already set * /
0.04s cl = clLvalue (s2v (cy-> func));
0.13s k = cl-> p-> k;
0.01s pc = cy-> u.l.savedpc;
0.01s if (trap) {
A simple move is taking an average of 0.15s (0.13s to 0.15s).
0.13s k = cl->p->k;
Wouldn't Lua benefit from dividing struct Proto in two?
Would it pay off?
regards,
Ranier Vilela
Follow-Ups
:
Re: Work In Progress: About Lua Structures
,
Spar
Prev by Date:
Making Lua accessible to everyone
Next by Date:
Re: Lua Patterns Viewer and Lua Infographics announcement
Previous by thread:
Re: Making Lua accessible to everyone
Next by thread:
Re: Work In Progress: About Lua Structures
Index(es):
Date
Thread