deno icon indicating copy to clipboard operation
deno copied to clipboard

Use code cache in `deno compile`

Open dsherret opened this issue 1 year ago • 1 comments

It seems it's not being used. We should investigate creating it lazily probably in a temp directory. I don't think we should use an sqlite database for this, but instead a more efficient append-only custom database.

Considerations:

  1. Different processes running the same binary could be updating the code cache at the same time.
  2. The cache could be updated at any time via a dynamic import.
  3. We want to minimize memory usage.
  4. Data corruption.

dsherret avatar Oct 24 '24 03:10 dsherret

Actually, what we could do here instead is just serialize the code cache of the modules during initial loading to a single file and keep dynamic imports dynamic. That would greatly simplify things and we could limit it to modules found in the binary so that we don't need to do any hashing.

dsherret avatar Oct 24 '24 13:10 dsherret