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

Performance Improvements & Some refactor #21

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

icarogtavares
Copy link

@icarogtavares icarogtavares commented Jan 1, 2024

Performance Improvements

main_fit.js +30%

Before

  • 6.157s
    image

After

  • 4.272s
    image

main.js +27%

Before

  • 385ms
    image

After

  • 282ms
    image

My machine:

Windows 11
Version 22H2 22621.2861)

CPU: i7 10700K
RAM: 48gb
DISC: 1TB SSD NVMe

NodeJS: v18.16.1

The biggest performance gain is the removal of reading/parsing JSON. I:

  • replaced to import via require (import only once instead of importing for every loadData call)
  • cloned matches/events only when necessary to not impact other executions

Refactor

  • Removed empty lines
  • Removed unused imports
  • Removed unused variables
  • Added enum for text pad direction
  • Added enum for regions
  • Added enum for sort order
  • Change some let to const when possible

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