Web optimization

  • SVG files might contain PNG files data:image/png;base64

    • It's best to export them as PNG

    • use Google's Squoosh and with the power of wasm to get web-ready image

    • exported as JPG files

  • Javascript has two clocks: performance.now() and new Date().

    1. performance.now() is significantly more precise. new Date() is precise to ±1ms, whereas performance.now() is precise to ±100μs. (Yes, microseconds!)

    2. performance.now() is strictly monotonic. In other words, it can never go back in time. If your machine time changes, new Date() will also change — ruining your data. But performance.now() will just keep counting.