]> git.kaiwu.me - njs.git/commit
Optimized nxt_dec_count() using bisection.
authorValentin Bartenev <vbart@nginx.com>
Thu, 25 Jul 2019 19:07:57 +0000 (22:07 +0300)
committerValentin Bartenev <vbart@nginx.com>
Thu, 25 Jul 2019 19:07:57 +0000 (22:07 +0300)
commit6a58535b0f365bd0f0a7059687d95443b81e1623
treea27d53d145506c12389945d1730cc04fcdaf1e8c
parent43700ddc5848efaaee49c77b4cd6e2e27774755d
Optimized nxt_dec_count() using bisection.

Previously, the number of comparisons required to count decimal numbers
was equal to decimal numbers count.

Now only 3 comparsions are needed for numbers with 1, 2, 3, 4, 5, or 6
decimal digits, and 4 comparsions are needed for numbers with 7, 8, 9,
and 10 decimal digits.
nxt/nxt_dtoa.c