slurmulon / bach

:musical_score: Semantic music notation
http://codebach.tech
MIT License
7 stars 0 forks source link

Optimize bach-cljs bundle and performance #25

Open slurmulon opened 3 years ago

slurmulon commented 3 years ago

Problem

The current bundle for bach-cljs package is quite large (around 400kb), and it also performs poorly, taking around 250ms to compile a simple three part track (yikes).

The same tracks return much quicker via CLI and bach-rest-api, so this almost certainly has to do with ClojureScript, and, I presume, the Google Closure dependencies.

Solution

Further research and isolate the cause of the poor performance in JavaScript.

Should also dig into bach.track/normalize-measures since this is by far the most complex method, and could be causing GC issues in JS land.

Also research shadow-cljs more deeply and determine if there are ways to optimize/tree-shake dependencies, most specifically the goog library.