Debugging with git bisect

Suppose I have this project with 5 commits. You can clone it from here. Say, there’s a regression bug in the master branch but a lot has been added to master after the feature was first inroduced. How would I go debugging this? Which commits break it? Usually, we would go manually and see which commit would possibly do this but if the project is large and active, it’s a quite troulesome process.
Read more →

Tips on reducing WASM file size with Emscripten

Optimize for size over performance # If size is more important than performance, you can use -Os flag. I tried with camaro and the file size reduce from 176KB down to 130KB. It’s worth a try. Disable assertion, debug # Try adding these flags: -s ASSERTIONS=0 and -DNDEBUG to emcc. Using emmaloc # Try using emmalloc which is a smaller malloc version available in emcc by adding -s 'MALLOC="emmalloc"' flag
Read more →

Some lessons learnt after converting a native module to WebAssembly

I released my first WebAssembly module here on GitHub. Here are some lessons I learnt during the process. Please don’t take it for granted. These things might be true, or not. I’m not sure. I just worked on it for the last few days. Cache WebAssembly instance to save some time on initialization # const Module = require('yourmodule') const mod = Module() const resolveCache = new Map() mod.onRuntimeInitialized = function() { resolveCache.
Read more →

Force Safari to refresh website’s favicon

How to force Safari to refresh website’s favicon by deleting its icons cache
Read more →