ClickHouse.Client icon indicating copy to clipboard operation
ClickHouse.Client copied to clipboard

decimal serialize performance!

Open mbtolou opened this issue 1 year ago • 2 comments

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?

mbtolou avatar Sep 26 '24 06:09 mbtolou

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 avatar Sep 27 '24 18:09 DarkWanderer

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:

  • Int128
  • Int256
  • .NET Framework support

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

DarkWanderer avatar Nov 07 '24 08:11 DarkWanderer