[PATCH v2 7/8] decimal: add conversions to (u)int64_t

Konstantin Osipov kostja at tarantool.org
Thu Aug 15 01:26:39 MSK 2019


* Serge Petrenko <sergepetrenko at tarantool.org> [19/08/13 17:20]:
> > Why do you think it's the best hint option? Why not keep 2-5 decimal
> > digits in a hint, as most currencies use? Would it slow down the
> > hing making process? You call decimalRescale anyway, it seems.
> 
> It wouldn’t slow down hint calculation (timing difference is tiny).
> It will slow down decimal comparison with doubles and integers, though.
> 
> We will get faster comparison for decimals that differ in first 2-5 fractional
> digits at the cost of having to cast every double and int to decimal for comparison
> with decimals.
> Is this worth it?

Please ask yourself this. How often do you think you will compare
a decimal with another decimal, compared to a decimal with a
float?

> > Is decimalRescale optimized to be a no-op if there is no need to
> > rescale?
> 
> Yes

Thanks.


-- 
Konstantin Osipov, Moscow, Russia



More information about the Tarantool-patches mailing list