counter-strike icon indicating copy to clipboard operation
counter-strike copied to clipboard

Performance Improvements & Some refactor

Open icarogtavares opened this issue 2 years ago • 0 comments

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

icarogtavares avatar Jan 01 '24 18:01 icarogtavares