Live data from Hacker News

Show HN: Plotting 3 years of hourly data in 150ms

leeoniya.github.io

111–118 of 118 posts

Re: Show HN: Plotting 3 years of hourly data in 150ms

#112
post #2

Unfortunately, I have to use Google Analytics and Google Ads at work every day, and these UIs have absolutely terrible performance :( A small part of the problem is drawing the trend charts. So I decided to make uPlot [1] to see what was really possible. [1] https://github.com/leeoniya/uPlot

This is a test reply please ignore it, it will be deleted in a few minutes.

Re: Show HN: Plotting 3 years of hourly data in 150ms

#114
I'm somewhat confused. Is 150ms considered low? That's less than 7fps.

336524=26280. Emitting 26k points is like child's play for any program, are we really so far down in bloat that this is considered impressive? Because this is not impressive. A 16MHz AVR could execute 91 instructions per sample in those 150ms, more than enough for plotting that data.

A 3GHz machine could execute 17123 instructions per sample, and it would probably need less instructions than the AVR would.

Re: Show HN: Plotting 3 years of hourly data in 150ms

#115

I'm somewhat confused. Is 150ms considered low? That's less than 7fps. 3 365 24=26280. Emitting 26k points is like child's play for any program, are we really so far down in bloat that this is considered impressive? Because this is not impressive. A 16MHz AVR could execute 91 instructions per sample in those 150ms, more than enough for plotting that data. A 3GHz machine could execute 17123 instructions per sample, an…

FWIW, the majority of this 150ms is bootup time and includes initializing the DOM & canvas, JITing the js, downloading & parsing the dataset, and actually running the code, which includes data downsampling & gap detection/clipping.

try to get this perf on the web, and then you can re-asses your statement. if it was easy, then every other js charting lib would not be struggling to do it, right?

for native code (or webgl), obviously this is child's play. but webgl has significant trade-offs. e.g: https://bugs.chromium.org/p/chromium/issues/detail?id=771792

finally, you cannot extrapolate from the 26k/150ms number. uPlot can draw 4.8M points in ~2000ms on an i5 with integrated gpu (after bootup amortization).

Re: Show HN: Plotting 3 years of hourly data in 150ms

#116
post #39

I find it curious that the volume of users are similar for day of the month regardless of year. For instance the first of the month is not always the same day of the week.

Eyeballing the data, there doesn't seem to be a strong weekday effect. Not sure if this is real data (human activity data usually show weekday effects). If there was a very pronounced weekday effect, a quick hack is to use a 364-day instead of full-year offset for comparison.

Agree. That's why i find it curious that it isn't representative of human activity but there definitely is seasonality.
Post reply on HN