philschatz / puzzlescript

:video_game: Play Accessible PuzzleScript games in your terminal or embed them
https://philschatz.com/puzzlescript/
28 stars 11 forks source link

chore: Improve Performance #153

Closed philschatz closed 5 years ago

philschatz commented 5 years ago

These speed up the communication between the webworker and the main UI thread by reducing the size of messages being passed around and the number of pixels that need to be updated:

It also replaces the quick-lru Map with a vanilla object map since the keys are always strings and object[key] lookup is faster than Map.get(...)

codecov[bot] commented 5 years ago

Codecov Report

Merging #153 into master will increase coverage by 0.18%. The diff coverage is 97.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #153      +/-   ##
==========================================
+ Coverage      48%   48.18%   +0.18%     
==========================================
  Files         150      150              
  Lines       12232    12277      +45     
  Branches      871      880       +9     
==========================================
+ Hits         5872     5916      +44     
- Misses       6188     6189       +1     
  Partials      172      172
Impacted Files Coverage Δ
src/lruCache.ts 100% <100%> (ø) :arrow_up:
src/models/rule.ts 92.85% <96.87%> (ø) :arrow_up:
src/engine.ts 89.32% <97.14%> (+0.47%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7711046...ccb7d60. Read the comment docs.