Coder Social home page Coder Social logo

Comments (6)

mohanson avatar mohanson commented on July 17, 2024 1

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.

mohanson avatar mohanson commented on July 17, 2024 1

I recently started learning chess (because of The Queen's Gambit

Maybe I will participate :)

from pywasm.

mohanson avatar mohanson commented on July 17, 2024 1

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.

void4 avatar void4 commented on July 17, 2024

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.

void4 avatar void4 commented on July 17, 2024

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.

mohanson avatar mohanson commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.