The AI Works community logo The Blockchain Works community logo The Functional Works community logo The Golang Works community logo The Java Works community logo The JavaScript Works community logo The Python Works community logo The Remote Works community logo The WorksHub company logo

We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies.

We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies. Less

We use cookies and other tracking technologies... More

Login or register
to publish this job!

Login or register
to save this job!

Login or register
to save interesting jobs!

Login or register
to get access to all your job applications!

Login or register to start contributing with an article!

Login or register
to see more jobs from this company!

Login or register
to boost this post!

Show some love to the author of this blog by giving their post some rocket fuel 🚀.

Login or register to search for your ideal job!

Login or register to start working on this issue!

Login or register
to save articles!

Login to see the application

Engineers who find a new job through WorksHub average a 15% increase in salary 🚀

You will be redirected back to this page right after signin

Measure default instance memory usage and optimize

Pull requests: 1
Contributors: 2
Level: Intermediate
  • Rust
Pull requests: 1
Contributors: 2
Level: Intermediate
  • Rust

On GitHub

Library for building cosmos-compatible wasm smart contracts
More info >

Issue posted by: 
ethanfrey's avatar

Ethan Frey

Description

I heard the default memory for instances was 32MB, which is far more than any contract I have written will need. The size of each one limits the number of contracts that can be held in memory via the Instance LRUCache.

It seems there is a fair bit of control of the memory regions that you can set up in an instance.

https://spectrum.chat/wasmer/runtime/share-memory-region-between-wasm-instances~3abfaa44-8fc8-4401-8590-1ec3bfbede5d

You can control min and max memory in the descriptor: https://docs.rs/wasmer-runtime/0.4.2/wasmer_runtime/wasm/struct.MemoryDescriptor.html

Measure the default memory usage (both of the wasm memory pages and the instance overhead (globals, wasm bytecode, etc). Then experiment on optimizing it, and experiment with the LRUCache. Definitely document this.

    Use Open Source to hire or get hired

    On GitHub

    Library for building cosmos-compatible wasm smart contracts
    More info >

    Issue posted by: 
    ethanfrey's avatar

    Ethan Frey

    Use Open Source to hire or get hired

    Measure default instance memory usage and optimize
    View on GitHub