Perspective Python v3 - Moar Performance

Ludicrously sized datasets with instant load

Perspective for Python

Perspective for Python uses the same C++ data engine used by the WebAssembly version. The library consists of many of the same abstractions and API as in JavaScript, as well as Python-specific data loading support for NumPy, Pandas (and Apache Arrow, as in JavaScript).

Additionally, perspective-python provides a session manager suitable for integration into server systems such as Tornado websockets, AIOHTTP, or Starlette/FastAPI, which allows fully virtual Perspective tables to be interacted with by multiple <perspective-viewer> in a web browser. You can also interact with a Perspective table from python clients, and to that end client libraries are implemented for both Tornado and AIOHTTP.

As <perspective-viewer> will only consume the data necessary to render the current screen, this runtime mode allows meaningfully larger-sized datasets, relative to JavaScript, with instant-load after they've been manifest on the server (at the expense of network latency on UI interaction).

Perspective v3 - Moar Performance

This is a snapshot of Perspective's Python benchmark suite, which runs ~100 iterations of 11 test functions against 13 versions of Perspective. There is one line for each version of Perspective.

Y axis =  average time each test took

X axis = test name in order of complexity

Perspective Python Performance Benchmarks

The "flatter" the curve, the faster Perspective is. The lines bunch up around 3 curves because we made 2 major changes to perspective-python architecture in the last 13 versions.

→ once when we improved the throughput in v2.4.0

and

→ once when we released Perspective v3.0.0

The chart illustrates that the 3.0.0 performance improvements are bigger and impact more test cases than the changes we made for performance approximately a year ago.