First day with Kotlin, and I’m hoping you kind folks can save me a few hours of research…
I need to serialise large hashmaps of trading bars to disk - many millions of records - for reading into a backtesting engine. The maps will be keyed with a Long timestamp. It’s a write-once, read often operation.
I’ll be running some benchmarks, but the FastBinaryEncoding library looks promising for the serialization, unless anyone has any better suggestions?
The records contain a number of basic data types for prices, volume etc. Ideally also enums, if the cost is not too high, but I could easily use a numeric index instead.
The records are immutable and dumb data containers. I don’t need any of the facilities of the Kotlin Data Class, and fear it is too heavy for this use-case.
In a system language I would be using a bare tuple or struct for something like this, but as a newbie I’m not at all clear how I should tackle this in Kotlin from the point of view of maximising read performance.
Any advice that would short-cut the learning process would be much appreciated!