Re:Show HN: uPlot.js – An exceptionally fast, tiny time seri...
by shusson on Thursday October 10, 2019 @10:10AM
(#21214677)
> 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.
Re:Show HN: uPlot.js – An exceptionally fast, tiny time seri...
by leeoniya on Thursday October 10, 2019 @12:51PM
(#21216698)
contributions welcome! :D
...but probably wait for 1.0
Re:Show HN: uPlot.js – An exceptionally fast, tiny time seri...
by leeoniya on Thursday October 10, 2019 @02:12AM
(#21211448)
i 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.htm...
Re:Show HN: uPlot.js – An exceptionally fast, tiny time seri...
by dkersten on Thursday October 10, 2019 @09:06AM
(#21213928)
I'd love a comparison with 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.
Re:Show HN: uPlot.js – An exceptionally fast, tiny time seri...
by leeoniya on Thursday October 10, 2019 @09:31AM
(#21214190)
i'll add echarts (as long as they have a sane api). also plot.ly i saw mentioned.
i should add it to the benchmarks :) probably based on 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
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.