Skip to content

Cache compression#234

Merged
sunfishcode merged 1 commit intobytecodealliance:masterfrom
mrowqa:cache-compression
Aug 23, 2019
Merged

Cache compression#234
sunfishcode merged 1 commit intobytecodealliance:masterfrom
mrowqa:cache-compression

Conversation

@mrowqa
Copy link
Contributor

@mrowqa mrowqa commented Jul 31, 2019

Based on #223. Some initial implementation of compression for cache system.

Things to discuss:

  • configuring compression level - I have temporarily added command line option for it, but it looks like too many details. It'd be probably better to have some performance presets for wasmtime (mentioned in Relocation of memory.grow and memory.size #199),
  • compression algorithm, currently using zstd
    • I preferred using official implementation with Rust bindings rather than some custom implementation; currently we require cmake and clang anyway, but we will probably want to not depend on them in future,
    • I did a quick research on different algorithms and other good choice could be lzma2. Anyway, it's hard to compare usage of specific algorithms without good benchmarks on our specific use case. I just do some quick test runs for having an approximated comparison.

@mrowqa
Copy link
Contributor Author

mrowqa commented Jul 31, 2019

Some perf runs:

With such comparisons it'd be nicer to have some chart. Anyway, looking at bigger files:

  • start without cache: lvl=3;5 not noticeable, lvl=10 very little overhead, lvl=20 big overhead
  • start with cache: lvl=3;5 visible overhead, but still not that big, lvl=10 visible improvement to previous one, still slower than no compression, lvl=20 again, visible improvement to previous level, still slower than without cache (note: the cache were probably read from OS filesystem cache; "hot buffer" in terminology of databases)
  • compression ratio: more or less 10% +-5%, each tested level introduced noticeable improvements. Cache without compression has low-mid entropy (what felt strange at first glance since usually code has high entropy).

@mrowqa mrowqa force-pushed the cache-compression branch from b04021a to f673675 Compare August 9, 2019 23:59
@mrowqa
Copy link
Contributor Author

mrowqa commented Aug 10, 2019

Rebased onto #230. I haven't removed the config option for compression level, but we'll do it soon anyway, when working on the cache daemon.

@mrowqa mrowqa force-pushed the cache-compression branch from f673675 to a39a39b Compare August 19, 2019 19:01
@mrowqa mrowqa force-pushed the cache-compression branch from a39a39b to ebc5030 Compare August 20, 2019 00:09
@mrowqa mrowqa marked this pull request as ready for review August 20, 2019 00:09
@mrowqa mrowqa mentioned this pull request Aug 22, 2019
Copy link
Member

@sunfishcode sunfishcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@sunfishcode sunfishcode merged commit 479592f into bytecodealliance:master Aug 23, 2019
@mrowqa mrowqa deleted the cache-compression branch August 23, 2019 23:39
grishasobol pushed a commit to grishasobol/wasmtime that referenced this pull request Nov 29, 2021
…ecodealliance#234)

This sort of conversion is useful for extracting custom error types from the
runtime when the error type is not Clone. Even when it is, it's more
efficient to unwrap it that to clone it.
dhil added a commit to dhil/wasmtime that referenced this pull request Oct 4, 2024
avanhatt pushed a commit to wellesley-prog-sys/wasmtime that referenced this pull request Apr 9, 2025
Verify `urem` lowerings.

Updates #34
dicej pushed a commit to dicej/wasmtime that referenced this pull request Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants