News for hackers. Stuff that matters.
Re:Perspective: Streaming pivot visualization via WebAssembly by stupidcar on Tuesday February 06, 2018 @12:04PM (#16317576)
Did you experiment with doing it JS-only prior to the C++ version? If so, what kind of performance increase did you see with WebAssembly?
Re:Perspective: Streaming pivot visualization via WebAssembly by spankalee on Tuesday February 06, 2018 @12:42PM (#16317869)
This++

WebAssembly can be certainly faster than JS in certain situations, but well-structured, monomorphic JS with the kind of type-hints for numeric values that asm.js is based off of can be extremely fast as well.

It'd be great to check the assumption that WASM is actually faster in this case, and by how much, especially given the friction of sending anything other than numbers across the JS/WASM boundary.

Re:Perspective: Streaming pivot visualization via WebAssembly by kodablah on Tuesday February 06, 2018 @05:12PM (#16320405)
And to be fair, you'd have to build it with something like prepack to get some of the optimizations LLVM gives you.
Re:Perspective: Streaming pivot visualization via WebAssembly by dman on Tuesday February 06, 2018 @12:08PM (#16317611)
No, when I first prototyped it I had written a Python version initially. From memory the first C++ build was ~80x faster than the Python prototype.
Re:Perspective: Streaming pivot visualization via WebAssembly by goatlover on Tuesday February 06, 2018 @01:08PM (#16318075)
80x faster than using Pandas? What if you just used the Numpy values array?
Re:Perspective: Streaming pivot visualization via WebAssembly by dman on Tuesday February 06, 2018 @01:12PM (#16318106)
You will get me into trouble! I said 80x faster than the Python prototype. I did benchmark this vs Pandas over the years and depending on the usecase the two codebases trade blows with each other for static data. However for streaming datasets Perspective has a large advantage over Pandas since pandas does a full group by on every update, while perspective does its work incrementally using deltas.
Re:Perspective: Streaming pivot visualization via WebAssembly by carapace on Tuesday February 06, 2018 @12:15PM (#16317661)
I'm curious if you did any profiling? If the intent was always to rewrite the whole prototype in C++ then it kinda wouldn't matter, eh?
Re:Perspective: Streaming pivot visualization via WebAssembly by texodus on Tuesday February 06, 2018 @12:23PM (#16317719)
We do some benchmarking just for catching performance regressions and validating assumptions against the non-WebAssembly version, but definitely need more in this regard. [benchmark for wasm build](https://jpmorganchase.github.io/perspective/examples/benchma...)
Re:Perspective: Streaming pivot visualization via WebAssembly by sciyoshi on Tuesday February 06, 2018 @12:55PM (#16317974)
I'd also be interested in some performance comparisons with a library like CrossFilter [1]. Does the improvement outweigh the penalties of crossing the JS/WebASM boundary?

[1] http://square.github.io/crossfilter/

Re:Perspective: Streaming pivot visualization via WebAssembly by texodus on Tuesday February 06, 2018 @12:59PM (#16318006)
The boundary-crossing is definitely the bottleneck right now. We are currently putting alot of work into the Apache Arrow support specifically to avoid this crossover, which will allow us to send data from the server in binary and avoid parsing in the browser.
Re:Perspective: Streaming pivot visualization via WebAssembly by polskibus on Tuesday February 06, 2018 @01:36PM (#16318297)
Can you elaborate on how that could work? Does arrow really allow for abstracting away the need for serialization even in JS - server scenarios? I though it was more of a shared memory data frame utility ?
Re:Perspective: Streaming pivot visualization via WebAssembly by texodus on Tuesday February 06, 2018 @03:11PM (#16319155)
There is an early arrow example in the examples package - superstore-arrow.html. The idea is that, instead of converting your data to internet->text->JSON->ArrayBuffer, you just keep the data in binary and write it directly into the C++ heap ArrayBuffer as-is. We currently do not read this in C++ directly for various reasons related to how emscripten allocates memory, but the general idea is the same.
Re:Perspective: Streaming pivot visualization via WebAssembly by BenGosub on Tuesday February 06, 2018 @01:35PM (#16318283)
bringing Apache Arrow in the browser alongside wasm is exciting to say the least! Amazing capabilities are coming to browsers...
Re:Perspective: Streaming pivot visualization via WebAssembly by lmeyerov on Tuesday February 06, 2018 @09:00PM (#16321711)
We (Graphistry) recently contributed a native JS reader/writer into the Apache Arrow project, so may help both teams! We did it as legwork for our beyond-native efforts (GPU cloud streaming) and taming our JS datatypes, so similar needs here I'm guessing!

Funny enough: was in NYC today talking with banking teams about related tech. Too bad we didn't know about this effort, would have loved to meet!

Re:Perspective: Streaming pivot visualization via WebAssembly by texodus on Wednesday February 07, 2018 @05:37AM (#16323543)
Yes, this is the library we use.

We have met before actually, you did a demo at JPM in midtown several years back. Graphistry has come a very long way since then - impressive work!

Re:Perspective: Streaming pivot visualization via WebAssembly by lmeyerov on Wednesday February 07, 2018 @06:29AM (#16323741)
Ah, small world. That was probably when we first started on client<>server GPU streaming. Looking forward to digging into the Perspective source!
Re:Perspective: Streaming pivot visualization via WebAssembly by dman on Tuesday February 06, 2018 @09:53PM (#16321910)
Drop me a note the next time you are in NY, would love to meet up.
Re:Perspective: Streaming pivot visualization via WebAssembly by infinite8s on Tuesday February 06, 2018 @04:06PM (#16319666)
In addition to what texodus has said below, Crossfilter only implements a small subset of what perspective provides. For example, no streaming (although there is a related project from the Heer lab that supports incremental updates - https://github.com/jheer/datavore), only a single level of grouping, only in 1 dimension, and you can only support 16 dimension fields at once (without increasing a constant in the codebase).