Comments (8)
fixed in #108, released in 0.4.36
from warp.
switch to https://developer.mozilla.org/en-US/docs/Web/API/structuredClone when it will be implemented by most of the browsers.
from warp.
👍🏻 Subscribing
from warp.
Performance comparison ("state evaluation" column) for "loot" contract:
@ungap/structured-clone
v8.deserialize(v8.serialize(input))
lodash/cloneDeep
JSON.parse(JSON.stringify(input, mapReplacer), mapReviver);
from warp.
Maybe I'm not reading the bench correctly, but isn't lodash more performant than ungap here?
from warp.
Maybe I'm not reading the bench correctly, but isn't lodash more performant than ungap here?
You're reading the bench correctly ;-) lodash indeed is more performant than ungap and v8 in this case. Though I believe that for "bigger" states - v8 was the winner. Anyway, I'll stick with lodash for now...
from warp.
Just a word of comment if anyone was interested - deepCopy-ing of the state is required for each interaction - before the state is passed to the contract's handler function. Contracts usually modify the state directly and without deepCopy - there would be risk of changing values somewhere in the host code (eg. values stored in cache).
v1 performed here simple stringify/parse https://github.com/ArweaveTeam/SmartWeave/blame/master/src/contract-step.ts#L56 - which obv. is least performant.
This won't be an issue in case of WASM contract - which store their state in the wasm module memory.
from warp.
Ah ok, I was confused with the commits being referenced using ungap, but they were probably old
🎉 Will try this
from warp.
Related Issues (20)
- [FEATURE] Allow Warp to register other L2 TXs HOT 13
- [FEATURE] - warp-contracts-redis for caching contract state HOT 1
- [BUG] - unable to set custom contract cache when using custom arweave gateway HOT 2
- [BUG] - no prevention of proecessing duplicate interactions returned from GQL HOT 1
- [BUG]: Mismatching blockheight on evaluation HOT 1
- [BUG] Deploy Plugin: Super constructor null of anonymous class is not a constructor HOT 2
- [BUG] Silent errors using `arlocal@^v1.1.63` HOT 12
- [BUG] - readStateBatch returns null for contract with no interactions HOT 1
- [BUG] Error thrown on doReadState HOT 2
- [FEATURE] - support sortKey or blockHeight in `viewState` HOT 1
- [BUG] Frontend build error starting with version 1.4.30 HOT 3
- [BUG] Not getting latest state when reading DRE node HOT 2
- [BUG] - maxInteractionEvaluationTimeSeconds larger than Number.MAX_SAFE_INTEGER
- [BUG] Getting different state with and without using DRE node HOT 5
- [BUG] - `viewState` with `sortKey` not using proper block information HOT 2
- [BUG] In Rust WASM imports, the `__wbg_height` function expects a number but receives a string, causing a crash
- [FEATURE] Allow Optional Input Placement in Warp Contract Interactions (Tags vs. Data)
- [BUG] - Uncaught TypeError: Cannot read properties of undefined (reading 'AbortError') on web HOT 5
- [BUG] - absolute path breaking builds HOT 1
- [BUG] - Property 'handle' in type 'AbstractContractHandler<State>' is not assignable to the same property in base type 'HandlerApi<State>'.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from warp.