Comments (3)
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.
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.
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)
- Question about IGC Parser HOT 2
- Box.distance() bug ?
- Possible speedup HOT 2
- Proper rounding procedure HOT 2
- Strip/tree shake debug code HOT 7
- Unhandled exception in 1.7.0 beta with some flights
- FAI-OAR flights report a wrong distance when used without cylinders
- Demo not working in Windows browsers HOT 2
- FAI Triangle not getting the further points HOT 1
- Scoring is undefined HOT 3
- Cannot read properties of undefined (reading 'heapUsed') HOT 2
- Parsing multiple igc file in a cause mac terminal to crash HOT 15
- Cannot read property 'r' of undefined HOT 5
- Moving average / flight detection HOT 4
- How to use with FAI scoring rules HOT 79
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 igc-xc-score.