Comments (6)
Thank you for your discovery. I have noticed the execution efficiency of pywasm. It spends a lot of time on https://github.com/mohanson/pywasm/blob/master/pywasm/execution.py#L18, because every time it access any value, it always need to regenerate the python object (int/float) from the byte(s).
The current performance of pywasm is not particularly good, I will try to optimize this part of the code.
from pywasm.
I recently started learning chess (because of The Queen's Gambit
Maybe I will participate :)
from pywasm.
I fixed the side effects of assertion in pywasm==1.0.7
, and at the same time improved the performance (about ~10%). I think I have a chance to double the running speed, but I need to think more (that is, not in this version).
-O
won't break the program anymore.
from pywasm.
That would be great! I'm using pywasm now to run the chess tournaments between programs (see here: https://rlc-chess.com/competitions :) (site takes a bit too load, but this is due to the frontend code, not pywasm in this case))
from pywasm.
I definitely want to create more experiments like this, say, let people write their own simple routing algorithms and see which one is the most resource-effective one: https://www.youtube.com/watch?v=Y8MvSAZ-YMk (https://github.com/void4/netsim)
For this I used Stackless Python because it supports suspending programs (and resuming them!) after some number of instruction steps: https://stackless.readthedocs.io/en/latest/library/stackless/pickling.html But Python cannot safely run untrusted programs, which is why WebAssembly would be a great target again.
With pywasm running faster, these kinds of projects will be much more feasible.
from pywasm.
Ah, looking through the pywasm code it seems that the asserts have side effects, that are necessary for it to be executed correctly.
It is not a good habit to produce side effects in assertions, so I will remove it, thanks.
from pywasm.
Related Issues (19)
- Pop out value from stack when call/invoke ends. HOT 3
- Support WASI(WebAssembly System Interface). HOT 10
- Issues with importing libraries HOT 4
- The big plan of Ancient: pywasm 1.0 HOT 3
- The structure of memoryInstance. HOT 6
- implement data count section
- Limiting the number of instruction steps HOT 4
- API Documents HOT 1
- Pywasm 1.0.4 does not install HOT 2
- Supplying a memory instance to a function before execution HOT 7
- Exception: pywasm: missing import env.time HOT 3
- Continuation of supplying a memory instance to a function before execution HOT 2
- Allow "minimum" and "maximum" in constructor for Limits object HOT 2
- Reattaching imported functions HOT 2
- Resuming a program where it left off when it reached a resource limit
- Example code has no print to terminal HOT 2
- Results seem to be different from wasmer HOT 1
- Cannot use "from pywasm import allocate_bytes, write_to_memory, address_to_utf8" HOT 1
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 pywasm.