-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce WAPM query caching to reduce wasmer run
's startup delay
#3983
Conversation
4be711a
to
817705d
Compare
I've added a filesystem cache in front of With this system, a cache miss from Australia takes about 800ms to query the WAPM backend ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once concern here: wasmer publish xxx
, wasmer run xxx
will run the old version.
Should we purge the cache for a package when publish is run?
I know this kind of inter-mingled logic is suboptimal, but I think it's an annoying UX gotcha otherwise.
e1bad73
to
e5664d1
Compare
70e1f2f
to
bba3f9d
Compare
We've discovered that there is a ~1 second delay on startup when running something like
wasmer run python/python
. After some investigation with @dynamite-bud, we narrowed it down to a GraphQL query which will be executed every single time we try to fetch metadata from something that looks like a WAPM package.wasmer/lib/wasix/src/runtime/resolver/wapm_source.rs
Lines 53 to 78 in f93f083
The simplest way to solve this is by caching the response from this sort of GraphQL query, marking the cached value as stale if it's older than (for example) 10 minutes or we've just run
wasmer publish
. It'd be nice if we could use a sqlite database for the cache, but I'm not sure how that'd go on the web.Fixes #3962