Since we can extract compilation artifacts, we can use them for caching. Opened https://github.com/bytecodealliance/wasmtime/pull/2065 for feedback. This replaces existing per-compiler caching logic.
@Alex Crichton I noticed it is stepping on https://github.com/bytecodealliance/wasmtime/pull/2059 a little, I think it makes sense to wait for your PR to land first
Nice! I'm fine landing in whatever order, it'll be nice to use the same caching logic!
by "caching logic", I assume, you mean the stuff coded in crates/environ/src/cache and not what it stored in cache entry?
uh, basically what's stored
where now we don't have two ways to serialize and two different deserialization phases
/me is confused a little
let's setup a call or something to talk about plans
so we are saving only code (and some compilation leftovers) in the cache
I'm proposing to save everything/ In addition to above, that includes transformed DWARF, Module
, data.
So serialize, theoretically will equal to cache save
oh yeah that makes sense to me
At this moment it is not
I was looking at the cache stuff recently and I'm really happy to move it higher up
it makes a lot more sense to just hash the entire wasm blob
rather than trying to hash lots of individual pices after parsing
okay, so I just want to make sure I'm on right track with the PR
oh I think you definitely are
I looked it over last night and it looked near-perfect to me
I remember I had a minor comment somewhere but I gotta read it again to figure out where
some people may argue that there is no need to save everything since we provide some (meta)data in wasm bytes
oh?
e.g. we could restore Module
for wasm bytes by re-parsing it, so its data
but I'm thinking it is additional effort in validation
anyway there are plenty of optimizations that can be done
@Yury Delendik sorry I'm not sure I'm understanding what you're saying
but it's ok, I'm still thinking the current PR is what we want
we could restore Module for wasm bytes by re-parsing it, so its data
I think we really shouldn't require reparsing the wasm file. There are scenarios in which you'd want to delete the input file after compilation, and directly use the hash to identify the cache entry
Last updated: Dec 23 2024 at 14:03 UTC