Learn in Public
  • Initial page
  • NOTES
    • Data Structures
      • Use cases
    • System Design
    • Angel Investing
    • Blockchain
      • Blockchain Interoperability
      • Consensus Algorithm
      • Wallet
      • dApps
    • Brain-computer interface
    • Cognitive Science
      • Memory
      • Neuroeconomics
    • JavaScript
      • Date
      • 📚Untitled
      • Basics
      • Front-end Interview Questions
      • JS Snippets
    • Machine Learning
      • OpenAI
    • MongoDB
    • GraphQL
    • TypeScript
    • UI / UX
    • Design Systems
    • Web Development
      • React
        • File Structure
        • Hooks 🎣
        • Next.js
      • Fetch API
      • Deployment
      • Accessibility
      • DNS Settings
      • css
        • CSS Structure
      • Pretty Website
      • Design Tools
      • Snippets
    • Remote
    • Flight Pricing
    • Mental Model
    • Surveillance
    • Web optimization
    • Archive
      • Cannabis
Powered by GitBook
On this page

Was this helpful?

  1. NOTES

Web optimization

PreviousSurveillanceNextArchive

Last updated 5 years ago

Was this helpful?

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

    • It's best to export them as PNG

    • use Google's 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, !)

    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.

References:

Squoosh
microseconds
https://blog.superhuman.com/performance-metrics-for-blazingly-fast-web-apps-ec12efa26bcb