DarkWanderer / ClickHouse.Client

.NET client for ClickHouse
MIT License
324 stars 67 forks source link

decimal serialize performance! #530

Open mbtolou opened 1 month ago

mbtolou commented 1 month ago

image

Hi, I used JetBrain to benchmark my software. What stands out is the low performance in converting decimals and writing them. Can you check where the problem is?

DarkWanderer commented 1 month ago

The reason for this is that I have opted to use BigInteger for ClickHouseDecimal as I wasn't confident in my ability to produce well-optimized Int128/Int256 classes, and there is no current widely used package with both. This is an interesting challenge however, might be time to revisit this

DarkWanderer commented 1 week ago

As a heads-up - I am looking into this in background, however, it would require rewriting ClickHouseDecimal completely to use blittable fixed-length integer types. The challenge is that from my research, there is no ready-to-use .NET library which has:

So I'll have to roll my own Int128 and Int256, which need some time to be carefully designed and tested. Bear with me