You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
store.get / Entity.load are currently slow because serializing even simple entities by allocating and writing to WASM memory is implemented in an inefficient way. We tracked this down to AscHeap::asc_new / AscHeap::raw_new causing a lot of small memory allocations, each of which take ~3-5ms. For a reasonably sized entity, this ends up at around 20-40 allocations and 150-200ms (locally, debug build).
What is likely taking so long under the hood is memory.grow() calls inside wasmi.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Clone and deploy any subgraph that uses Entity.load and follow the logs. You should see Store get messages that are fast, but Done processing Ethereum event messages that indicate the handler takes a long time (~500-1500ms):
The expected behavior is that each handler takes only a few milliseconds, even with store.get / Entity.load involved. The serialization of an entity to WASM should ideally only take <5ms overall.
The text was updated successfully, but these errors were encountered:
@MaxGraey thanks for the pointer, right now we're on a pre-runtime version of AS and upgrading won't be easy because we write objects in the AS memory format. We're hoping to get WASM Interface Types before upgrading again.
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
store.get
/Entity.load
are currently slow because serializing even simple entities by allocating and writing to WASM memory is implemented in an inefficient way. We tracked this down toAscHeap::asc_new
/AscHeap::raw_new
causing a lot of small memory allocations, each of which take ~3-5ms. For a reasonably sized entity, this ends up at around 20-40 allocations and 150-200ms (locally, debug build).What is likely taking so long under the hood is
memory.grow()
calls inside wasmi.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Clone and deploy any subgraph that uses
Entity.load
and follow the logs. You should seeStore get
messages that are fast, butDone processing Ethereum event
messages that indicate the handler takes a long time (~500-1500ms):What is the expected behavior?
The expected behavior is that each handler takes only a few milliseconds, even with
store.get
/Entity.load
involved. The serialization of an entity to WASM should ideally only take <5ms overall.The text was updated successfully, but these errors were encountered: