Code Monkey home page Code Monkey logo

Comments (4)

loboris avatar loboris commented on September 26, 2024

It has nothing to do with the calculation speed, but with loop execution speed.
There is a VM hook enabled (MICROPY_VM_HOOK_LOOP) which handles keyboard interrupt during bytecode execution, but in a very inefficient way.
Without it enabled the times are:

System freq: 398.7 MHz
Add test:  2.834 s
Mul test:  3.183 s
Div test:  3.072 s
Pi test:  4.435 s
System freq: 806.0 MHz
Add test:  1.401 s
Mul test:  1.573 s
Div test:  1.471 s
Pi test:  2.173 s

I'll try to implement this hook in a different, more efficient, way.
Also some other optimization can be done to improve the performance...

from micropython_k210_lobo.

robert-hh avatar robert-hh commented on September 26, 2024

OK. Minor differences do not matter. The fastest device with that test is anyhow the PyBoard, mostly due to the traditional internal RAM. But at 800MHz, the K210 comes close, but at much higher power consumption.

from micropython_k210_lobo.

loboris avatar loboris commented on September 26, 2024

I've tested a different approach for keyboard interrupt and it now works without impacting the performance.
I'll test it some more, and commit it tommorow.

BTW, the floating point operations are faster than on PyBoard, especially considering the fp operations are double precission...

from micropython_k210_lobo.

robert-hh avatar robert-hh commented on September 26, 2024

I've noticed that. The Pi test which makes heavy use of floats runs much faster. And there are more goodies in having 64 bit ints and double floats.
About the change: do not hurry. I just got another task to accomplish form my daughter. That's topmost priority.

from micropython_k210_lobo.

Related Issues (20)

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.