Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add js import enum benchmark #3906

Merged
merged 7 commits into from Apr 2, 2024

Conversation

Davidster
Copy link
Contributor

@Davidster Davidster commented Mar 29, 2024

In preparation for solution 3 from #3468 (comment), I have added a benchmark for the case of passing imported enums to a js function.

Current benchmark results is sitting at 212/s ±3.51% (around half a microsecond per function call, which is extremely slow)

Spoiler: I have a (unfinished) branch containing solution 3 and the benchmark goes up to 12,183/s ±1.1% which brings it in line with the 'Call a custom JS class Foo.bar method with structural' benchmark. In my engine, this means I save 2ms per frame in scenes with lots of objects (where set_index_buffer is called often).

Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the nits, LGTM!

CHANGELOG.md Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
benchmarks/globals.js Outdated Show resolved Hide resolved
@Davidster Davidster requested a review from daxpedda April 1, 2024 17:30
Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@daxpedda daxpedda merged commit 9347af3 into rustwasm:main Apr 2, 2024
25 checks passed
daxpedda pushed a commit to daxpedda/wasm-bindgen that referenced this pull request May 21, 2024
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.

None yet

2 participants