GithubHelp home page GithubHelp logo

[Question] Perfomance about igc-xc-score HOT 3 OPEN

mmomtchev avatar mmomtchev commented on June 12, 2024
[Question] Perfomance

from igc-xc-score.

Comments (3)

mmomtchev avatar mmomtchev commented on June 12, 2024

WASM won't be faster for sure.

C++ could be marginally faster, but the real benefit will be portability and multithreading. The algorithm used is naturally parallel and igc-xc-score cannot take advantage of it because of the lack of good shared memory data structures - especially R-Trees - in Node.js.

I did briefly consider creating a C++ version - not because it is faster - but because it could be embedded on a flight computer. However the development of my affair caught up with the flight instrument manufacturers.

If you can find all the base components - I think that boost has everything but the packed Hilbert R-Trees - there should probably be about 2 weeks of work.

from igc-xc-score.

vicb avatar vicb commented on June 12, 2024

Thanks for the insight.

Do you think it would be a lot of work to implement this shared data structure in JS (using SharedArrayBuffer/Atomics)?

One benefit I see with C/C++ code is also that it would easily transpile to WASM meaning that we could have support for browser + node for free (including multi-threading).

I'll work more on that in a few weeks and will keep this updated.

from igc-xc-score.

mmomtchev avatar mmomtchev commented on June 12, 2024

Sure, you could, but frankly WASM is still somewhat rough on the edges - no one uses WASM when there is a JS version.

Making a packed Hilbert R-Tree in a SharedArrayBuffer that supports concurrent access is a project that is slightly larger than igc-xc-score itself with an end result that will probably have no other uses.

The latest version can process even the most complex flights in under 1 minute, which is about ok, and given my precarious current standing with the paragliding community - I would prefer to see where my affair is going before investing large amounts of time in this project.

Maybe there could be an intermediate solution that supports only back-end processing in Node.js and uses shared data structures from C++/boost. This could probably be made to work in a week of hard work or so. Especially if NAPI supports is finally added to SWIG - which is probably a much better use of my time. Not that my current standing with the Node.js core team is any different - but simply because it is a much more needed project. Once this is done, a partially C++, partially JS parallel version of igc-xc-score will be much easier to make.

I do not remember who said it, but I always found it right on the target: V8 is a C++ engine that you can pilot by using JavaScript.

from igc-xc-score.

Related Issues (16)

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.