Files
RustAst/examples/record_specialization_test.myc
T

26 lines
592 B
Plaintext

;; Benchmark: 834ns
;; Benchmark-Repeat: 2387
;; Test Record SoA specialization in Pipelines
;; Dank der neuen Spezialisierung wird hierfür im Hintergrund
;; eine SharedRecordSeries mit SoA-Layout (Float-Puffer für mid und range) erstellt.
;; Output: <StreamNode>
(do
(def ohlc_stream (create-random-ohlc 42 10))
;; Pipe die einen Record erzeugt
(def indicator
(pipe [ohlc_stream]
(fn [ohlc]
{
:mid (/ (+ (.high ohlc) (.low ohlc)) 2.0)
:range (- (.high ohlc) (.low ohlc))
}
)
)
)
indicator
)