Add Series RTL and SeriesView
Introduces a new RTL module for handling series data, enabling efficient storage and retrieval of time-series data in a Struct-of-Arrays (SoA) format. Includes `SeriesView`, a zero-copy wrapper that provides a fast, read-only interface to individual columns within a `RecordSeries`, optimizing performance for data access in the VM. Registers new native functions `create-series` and `push-series` for managing series data.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
;; Output: 26.7
|
||||
;; Benchmark: 998ns
|
||||
;; Benchmark-Repeat: 2047
|
||||
(do
|
||||
(def template {:price 10.0 :volume 100})
|
||||
(def my_ticks (create-series template))
|
||||
|
||||
(push-series my_ticks {:price 10.5 :volume 100})
|
||||
(push-series my_ticks {:price 11.2 :volume 200})
|
||||
(push-series my_ticks {:price 15.5 :volume 300})
|
||||
|
||||
(def prices (.price my_ticks))
|
||||
|
||||
(+ (prices 0) (prices 1))
|
||||
)
|
||||
Reference in New Issue
Block a user