Skip to content

feat: native timer polyfills #1733

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

Merged
merged 5 commits into from
Nov 17, 2022
Merged

Conversation

edusperoni
Copy link
Collaborator

This adds a very complete timer polyfill that follows closely the chromium implementation.

Still needs unit testing, I'll add some before merge

@cla-bot cla-bot bot added the cla: yes label Oct 21, 2022
@edusperoni edusperoni requested a review from triniwiz October 21, 2022 21:41
@jarmani
Copy link

jarmani commented Oct 31, 2022

@edusperoni Hello ! Out of curiosity, what is the main advantage comparing to the current implementation ?
This will be also implemented in the iOS runtime ?

@edusperoni
Copy link
Collaborator Author

@jarmani yes, I intend to do a similar implementation on the iOS side.

The main advantage is that it's 2-4x faster for scheduling and firing callbacks as it doesn't hit the JNI bridge anymore. Additionally, in my tests the current timeout will freeze the app scheduling a huge amount of timeouts (like 1e5), which doesn't happen on this implementation.

@jarmani
Copy link

jarmani commented Nov 1, 2022

@edusperoni Amazing, thanks for the explanation !

@NathanWalker NathanWalker changed the base branch from master to feature/v8-update-static-perf November 17, 2022 03:27
@vmutafov vmutafov changed the base branch from feature/v8-update-static-perf to master November 17, 2022 19:44
@vmutafov vmutafov changed the base branch from master to feature/v8-update-static-perf November 17, 2022 19:46
@vmutafov vmutafov merged commit 3415e5c into feature/v8-update-static-perf Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants