Skip to content

Conversation

@CppCXY
Copy link
Owner

@CppCXY CppCXY commented Dec 1, 2025

No description provided.

- Add call_cfunc_metamethod_1/2/3 for 1/2/3 argument CFunction calls
- Avoid Vec allocation in metamethod calls by using fixed-size paths
- Optimize call_function_internal: only init registers beyond args
- Remove stack cleanup on normal return (let GC handle stale refs)
- Update table_get_with_meta/table_set_with_meta to use fast paths
- Update userdata_get and string_get with CFunction fast paths

Performance improvements:
- __index (table): +22% (18M -> 22M ops/sec)
- __newindex: +33% (4.5M -> 6M ops/sec)
- __len: +10% (4.6M -> 5.1M ops/sec)
- ipairs: +150% (10K -> 25K iters/sec)
- pairs on hash: approaches native Lua performance
@CppCXY CppCXY merged commit af964dc into main Dec 1, 2025
4 checks passed
@CppCXY CppCXY deleted the gc branch December 2, 2025 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant