595bcf09e5
The `PipelineNode` has been refactored into `StreamNode`. This commit updates the example files to reflect this change and also updates the `series` constructor to accept a lookback parameter. The `PipelineNode` was an artifact of a previous implementation and is no longer needed. The `StreamNode` is the appropriate type for representing the output of a pipe operation. The `series` function now requires a `lookback` argument to specify the maximum number of items to store. This makes the behavior of series more explicit and prevents accidental unbounded memory growth.
26 lines
592 B
Plaintext
26 lines
592 B
Plaintext
;; Benchmark: 1.5us
|
|
;; Benchmark-Repeat: 1348
|
|
;; 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
|
|
)
|