3 ms·
For anyone interested in this kind of stuff, I wrote my own Vector Virtual Machine (VVM) as part of the Empirical project [1]. It has statically-typed vector-aw
by chrisaycock 5y ago
For anyone interested in this kind of stuff, I wrote my own Vector Virtual Machine (VVM) as part of the Empirical project [1]. It has statically-typed vector-aware opcodes. It uses register addressing (inspired by LLVM), has a linear IR, and is implemented with tricks like computed gotos.
I designed VVM to have extremely fast dispatch. It already exists on top of a vector-aware runtime, which means that a single dispatch works over an entire array. But grouped aggregations require multiple dispatches, one per unique key in a Dataframe. For example:
from trades select volume = sum(size) by symbol
I wanted to hit the runtime repeatedly with as little overhead as possible. So VVM has no type look-up, multiple operands per instruction, and a cache-efficient IR. The sum() operand for the above example is invoked directly in a loop almost as fast as hand-written C++.
VVM has its own assembly language [2]. I have blog post that explains some of the design choices [3].
[1] https://github.com/empirical-soft/empirical-lang/tree/master/src/VVM https://github.com/empirical-soft/empirical-lang/tree/master...
[2] https://github.com/empirical-soft/empirical-lang/tree/master/tests/VVM https://github.com/empirical-soft/empirical-lang/tree/master...
[3] https://www.empirical-soft.com/2020/09/03/a-tour-of-the-vector-virtual-machine.html https://www.empirical-soft.com/2020/09/03/a-tour-of-the-vect...