flatironinstitute / stan-playground

Run Stan models in the browser
Apache License 2.0
36 stars 1 forks source link

Reduce redundant compilation jobs #138

Closed magland closed 4 months ago

magland commented 4 months ago

Right now every time you reload the page a new compilation job is created. It uses the cached wasm file, but it does create a new directory, etc. To reduce redundancy I propose:

In browser local storage, keep a mapping (stan file hash) -> job ID. So when it comes time to compile, the client checks this table and checks for the existence of the wasm file. If it exists, then it uses that. If not, then it removes the entry in the table and proceeds as before.