Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(221)

Issue 5491064: code review 5491064: strconv: reduce buffer size for multi-precision decimals. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 7 months ago by remyoudompheng
Modified:
13 years, 7 months ago
Reviewers:
CC:
golang-dev, bradfitz, rsc, remy_archlinux.org
Visibility:
Public.

Description

strconv: reduce buffer size for multi-precision decimals. The longest numbers we have to represent are the smallest denormals. Their decimal mantissa is not longer than 5^1100. Taking into account some extra size for in-place operations, 800 digits are enough. This saves time used for zero intiialization of extra bytes. old ns/op new ns/op delta strconv_test.BenchmarkAtof64Decimal 521 334 -35.9% strconv_test.BenchmarkAtof64Float 572 391 -31.6% strconv_test.BenchmarkAtof64FloatExp 10242 10036 -2.0% strconv_test.BenchmarkAtof64Big 4229 4029 -4.7% strconv_test.BenchmarkFormatFloatDecimal 1396 934 -33.1% strconv_test.BenchmarkFormatFloat 4295 3341 -22.2% strconv_test.BenchmarkFormatFloatExp 12035 11181 -7.1% strconv_test.BenchmarkFormatFloatBig 4213 3229 -23.4% strconv_test.BenchmarkAppendFloatDecimal 1031 600 -41.8% strconv_test.BenchmarkAppendFloat 3971 3044 -23.3% strconv_test.BenchmarkAppendFloatExp 11699 11003 -5.9% strconv_test.BenchmarkAppendFloatBig 3836 2915 -24.0%

Patch Set 1 #

Patch Set 2 : diff -r 3036d2362ea5 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 3036d2362ea5 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -3 lines) Patch
M src/pkg/strconv/decimal.go View 1 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 5
remyoudompheng
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com, remy@archlinux.org), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 7 months ago (2011-12-16 23:08:23 UTC) #1
bradfitz
Update the TODO that's in that struct? On Fri, Dec 16, 2011 at 3:08 PM, ...
13 years, 7 months ago (2011-12-16 23:10:48 UTC) #2
rsc
The TODO is for a different idea, which may or may not be possible.
13 years, 7 months ago (2011-12-16 23:12:11 UTC) #3
rsc
LGTM
13 years, 7 months ago (2011-12-19 20:03:50 UTC) #4
rsc
13 years, 7 months ago (2011-12-19 20:03:57 UTC) #5
*** Submitted as http://code.google.com/p/go/source/detail?r=ac6c5970cc33 ***

strconv: reduce buffer size for multi-precision decimals.

The longest numbers we have to represent are the smallest denormals.
Their decimal mantissa is not longer than 5^1100. Taking into
account some extra size for in-place operations, 800 digits are
enough. This saves time used for zero intiialization of extra
bytes.

                                        old ns/op  new ns/op    delta
strconv_test.BenchmarkAtof64Decimal           521        334   -35.9%
strconv_test.BenchmarkAtof64Float             572        391   -31.6%
strconv_test.BenchmarkAtof64FloatExp        10242      10036    -2.0%
strconv_test.BenchmarkAtof64Big              4229       4029    -4.7%
strconv_test.BenchmarkFormatFloatDecimal     1396        934   -33.1%
strconv_test.BenchmarkFormatFloat            4295       3341   -22.2%
strconv_test.BenchmarkFormatFloatExp        12035      11181    -7.1%
strconv_test.BenchmarkFormatFloatBig         4213       3229   -23.4%
strconv_test.BenchmarkAppendFloatDecimal     1031        600   -41.8%
strconv_test.BenchmarkAppendFloat            3971       3044   -23.3%
strconv_test.BenchmarkAppendFloatExp        11699      11003    -5.9%
strconv_test.BenchmarkAppendFloatBig         3836       2915   -24.0%

R=golang-dev, bradfitz, rsc
CC=golang-dev, remy
http://codereview.appspot.com/5491064

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b