Skip to content

Conversation

@AnsonYeung
Copy link

This PR rewrites the runtime to make use of an array instead of allocating a new object for each frame. Some benchmark is necessary before this PR is ready since this is meant to improve the performance. Using a separate Uint32Array to store integer values in the array may yield further improvement as it will further reduce gc overhead, but at a cost of a more complicated unwind implementation.

@AnsonYeung AnsonYeung changed the base branch from mlscript to hkmc2 January 31, 2026 16:04
@AnsonYeung
Copy link
Author

I have experimented with preallocating a fixed size for the array and it yields mixed result. Presumably the extra memory usage of the array might cause extra gc overhead from scanning the array.

@AnsonYeung
Copy link
Author

As a side note, will it be a good idea to have the benchmark part of #335 merged before the rest of the PR?

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