4 ms·
Awesome!! It's been disheartening to see flotjs (which was essentially unmaintained for 5 years) still beat out scores of other charting libraries in terms of r
by seanlaff 7y ago
Awesome!! It's been disheartening to see flotjs (which was essentially unmaintained for 5 years) still beat out scores of other charting libraries in terms of raw speed.
Over the last few years we've tried a lot of different techniques, eventually settling on using Vega with our own interaction layer ontop- but I'd like to give this a try. I'd love if this library handled the sizing of all the elements as vega would, but I understand the desire to keep this small... I browsed the entirety of the source code on my phone!
One of our use cases is streaming high frequency data- do you still see uPlot performing better than the alternatives in that scenario?
- leeoniya 7y ago> Awesome!! It's been disheartening to see flotjs (which was essentially unmaintained for 5 years) still beat out scores of other charting libraries in terms of raw speed. i should add it to the benchmarks :) probably based on https://www.flotcharts.org/flot/examples/axes-time/index.html https://www.flotcharts.org/flot/examples/axes-time/index.htm... > Over the last few years we've tried a lot of different techniques, eventually settling on using Vega with our own interaction layer ontop- but I'd like to give this a try. I'd love if this library handled the sizing of all the elements as vega would i'll add Vega, too based on https://vega.github.io/editor/#/examples/vega-lite/line https://vega.github.io/editor/#/examples/vega-lite/line as far as label/element sizing goes, right now uPlot's labels are just absolutely positioned divs; vega's are canvas text. in addition, uPlot simply blows away and re-creates all labels on each zoom/unzoom action - far from ideal, but more than fast enough for manual ranging/zooming. i could potentially move to canvas text as well as a starting point, but there are many trade-offs to consider or whether it's necessary at all. i would like to see what type of label sizing you guys take advantage of with Vega to understand how extensive the implementation would have to be to offer something similar. > One of our use cases is streaming high frequency data- do you still see uPlot performing better than the alternatives in that scenario? that's a loaded question. and the answer is that it really depends on the frequency and the amount of data. if you can give me a function that simulates the type of data feed & rate you're dealing with, along with how much data you expect to be shown at any one time, then i can give you a better answer. right now, if you open the benchmark in the repo and toggle the series on/off while recording perf in devtools, you'll see that it takes ~12ms to redraw the 170k point chart, which includes auto-scaling. this is enough to do 60fps, but does not leave much frame budget for much else. in a real streaming case, i would expect the actual numbers to be much lower than 60hz data updates and much fewer than 170k concurrently displayed points. in addition, i would probably turn off auto-scaling, since it would be very distracting to have the chart rescale constantly. if you'd be interested in providing a data stream simulation, then we can work through an example. feel free to open an issue if you're interested in fleshing this out.
- leeoniya 7y agoi tested Flot [1] locally and got 351ms/45MB heap vs 45ms/20MB heap for uPlot on this machine. (the numbers in the readme are from another machine that's maybe 20% slower). i'll update the bench table tomorrow when i run it there. for Vega, i could use your help to add it to the list. learning exactly how its schemas work does not sound like a good time to me. [1] https://github.com/leeoniya/uPlot/blob/master/bench/Flot.html https://github.com/leeoniya/uPlot/blob/master/bench/Flot.htm...
- dkersten 7y agoI'd love a comparison with https://echarts.apache.org/ https://echarts.apache.org/ but I understand if you don't feel like it or don't have the time. I'd do it myself, but I don't have much spare time right now :( So, feel free to ignore, but if you do, that would be awesome.
- shusson 7y ago> i'll add Vega I don't think you should really add Vega as a comparison. It's more about describing charts than rendering them (Vega-lite comes with a renderer baked in). In fact it would be nice if uPlot could be a renderer for Vega.