Skip to content

Design Meeting Notes, 8/30/2024 #59809

Open
@DanielRosenwasser

Description

Adding Compile-Caching Entry Points

#59720

  • Node.js now supports V8 compilation caching.
    • Recent PR to Node.js to add module.enableCompilerCache().
    • Previously were ways to do this with 3rd party packages on npm.
  • Node.js doesn't do this by default, but things like ts-node does on supported versions of Node.js.
  • What's the downside?
    • You need to have require to make this work, awkward for ESM.
    • This is being worked on.
  • tsc and tsserver start up about 2.3x faster.
  • For executables this is a no-brainer. We can actually use import() there too.
  • For libraries, questionable. So the PR doesn't do it.
  • The PR must introduce a new entry point for the library. Is this worth the perf improvement?
    • Yes.
    • Just add a comment telling people what's going on and it's fine.
  • Another risk - in development we recompile over and over, and that can pollute the cache.
    • The files are pretty small - not a huge risk.
    • We can add hereby clear-node-cache.
  • Not going to be immediate - Node-specific work would need to be back-ported in in Node.js 22; otherwise only noticeable in Node 23+.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Design NotesNotes from our design meetings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions