Technical Indicator Calculation on Web Workers #25
tradex-app
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the quest for performance improvements, work is currently being done on how the chart calculates indicators.
The first improvement is having the chart only calculate the required indicator data instead of the entire price history when new chunk of back history data is added.
The chart currently uses talib-web for indicator calculation. It is a port of the technical analysis library written in C, ported to WebAssembly. The current release of TradeX uses this library on the main thread. If there is a large price history to process, this can lead to the main JavaScrpt loop (thread) being blocked and causing the browser tab to unresponsive. So the option of moving the indicator calculation to a web worker, a separate thread to free up the main thread is being explored.
I now have the TALib-web wasm initializing on a web worker. This was quite a challenge and required a good deal of research and trying numerous options before a solution was found. In the end the simplest was best.
Next step is to call the TALib functions in the worker and have the results returned.
If that works, then I can finally do the following test comparisons:
1a. browser comparisons of the above
2.a browser comparisons
technicalindicators is another library, but is pure JavaScript (now wasm)
I want to see the wasm vs JS performance comparison.
The results might be surprising.
Beta Was this translation helpful? Give feedback.
All reactions