Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move: source service eagerly hydrates modules in memory (MystenLabs#1…
…2840) ## Description Eagerly reads and hydrates source code on server start. Doing this eagerly is reasonable right now since source is small (we might opt for gzip later too): ``` 244K sui-framework/packages/deepbook/sources 72K sui-framework/packages/move-stdlib/sources 348K sui-framework/packages/sui-framework/sources 240K sui-framework/packages/sui-system/sources ``` The type is set up with `Option` to allow hydrating source on first request too, but I didn't want to go that route because then we need to implemented a writer lock and seems pretty overkill given scope right now. --- For fun I looked at the local latency difference before/after this PR. This isn't really meaningful on a local setup, but I've got the tooling set up with `vegeta` for testing eventual deployment so figured to look anyway. 100 requests per second over 15 seconds (latencies generally lower with this PR). Before ``` Requests [total, rate, throughput] 1500, 100.07, 100.06 Duration [total, attack, wait] 14.991483416s, 14.989767291s, 1.716125ms Latencies [mean, 50, 95, 99, max] 1.544413ms, 1.475097ms, 2.169692ms, 3.43996ms, 8.906125ms Bytes In [total, mean] 5073000, 3382.00 ``` After ``` Requests [total, rate, throughput] 1500, 100.07, 100.06 Duration [total, attack, wait] 14.991182792s, 14.990031292s, 1.1515ms Latencies [mean, 50, 95, 99, max] 1.316599ms, 1.270261ms, 1.769853ms, 2.501024ms, 5.567708ms Bytes In [total, mean] 5073000, 3382.00 ``` ## Test Plan Updated test to use hydrated value.
- Loading branch information