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

feat: optimized the code (for..let loops over for..of, faster string join algo, etc.) #184

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

ncpa0cpl
Copy link
Collaborator

Added code optimizations:

  1. Instead of for..of loops that rely on iterators used the good ol' for..let i = 0; loops which are much faster
  2. Replaced all usages of String.join() with a much faster custom implementation
  3. Reduced the amount of needless object instantiations, (there were some places where a new object or array was created for convenience reasons, but was not really necessary) - this should slightly reduce the required GC time for cases where a lot of JSX is being processed.
  4. JSX Elements props and children are made immutable up-front via Object.freeze

@ncpa0cpl ncpa0cpl merged commit 16ded89 into master Aug 22, 2023
@ncpa0cpl ncpa0cpl deleted the feat/optimizations branch August 22, 2023 11:08
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