tangrams / tangram

WebGL map rendering engine for creative cartography
https://tangram.city
MIT License
2.22k stars 290 forks source link

Cache user-defined JS functions #684

Closed bcamper closed 6 years ago

bcamper commented 6 years ago

This caches user-defined JS functions for the scene (e.g. for filters, colors, etc.) by their unique source code. This can lead to substantial decrease in the number of functions that have to be compiled when using globals. On Mapzen/Nextzen styles, the reduction is anywhere from 40% (on Bubble Wrap) to almost 300% (on Walkabout). Additionally, the cache is cleared when a new scene is loaded, so these functions can be freed.