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

Issue 6303087: code review 6303087: strconv: extend Grisu3 algorithm to float32. (Closed)

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

Description

strconv: extend Grisu3 algorithm to float32. Also improve extfloat.Normalize to obtain a modest performance gain in parsing, and add a shortcut path for exact integers. benchmark old ns/op new ns/op delta BenchmarkAtof64Decimal 73 73 -0.54% BenchmarkAtof64Float 91 91 -0.54% BenchmarkAtof64FloatExp 198 180 -9.09% BenchmarkAtof64Big 307 308 +0.33% BenchmarkAtof32Decimal 72 72 +0.42% BenchmarkAtof32Float 83 83 -0.72% BenchmarkAtof32FloatExp 212 186 -12.26% BenchmarkAtof32Random 262 250 -4.58% BenchmarkAppendFloatDecimal 474 305 -35.65% BenchmarkAppendFloat 497 489 -1.61% BenchmarkAppendFloatExp 493 483 -2.03% BenchmarkAppendFloatNegExp 481 481 +0.00% BenchmarkAppendFloatBig 667 652 -2.25% BenchmarkAppendFloat32Integer 338 307 -9.17% BenchmarkAppendFloat32ExactFraction 364 439 +20.60% BenchmarkAppendFloat32Point 1299 490 -62.28% BenchmarkAppendFloat32Exp 2593 489 -81.14% BenchmarkAppendFloat32NegExp 5116 481 -90.60%

Patch Set 1 #

Patch Set 2 : diff -r 47e7c99fbe87 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 47e7c99fbe87 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 4 : diff -r 47e7c99fbe87 https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 5 : diff -r 3909e0071e70 https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r b90fb8c2bb6f https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -60 lines) Patch
M src/pkg/strconv/decimal.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/strconv/extfloat.go View 1 2 3 4 3 chunks +48 lines, -29 lines 0 comments Download
M src/pkg/strconv/ftoa.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/strconv/ftoa_test.go View 1 2 3 1 chunk +14 lines, -28 lines 0 comments Download

Messages

Total messages: 11
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, 12 months ago (2012-06-15 21:29:41 UTC) #1
rsc
Why did BenchmarkAppendFloat32Decimal get slower? Is the grisu slower than the old case for the ...
13 years, 11 months ago (2012-06-19 04:05:15 UTC) #2
rsc
LGTM
13 years, 11 months ago (2012-06-19 04:05:20 UTC) #3
remyoudompheng
Hello rsc@golang.org (cc: golang-dev@googlegroups.com, remy@archlinux.org), Please take another look.
13 years, 11 months ago (2012-06-19 06:46:36 UTC) #4
rsc
LGTM http://codereview.appspot.com/6303087/diff/4002/src/pkg/strconv/extfloat.go File src/pkg/strconv/extfloat.go (right): http://codereview.appspot.com/6303087/diff/4002/src/pkg/strconv/extfloat.go#newcode201 src/pkg/strconv/extfloat.go:201: if f.exp < 0 && mant == (mant>>uint(-f.exp))<<uint(-f.exp) ...
13 years, 11 months ago (2012-06-19 15:11:26 UTC) #5
remyoudompheng
Hello rsc@golang.org (cc: golang-dev@googlegroups.com, remy@archlinux.org), Please take another look.
13 years, 11 months ago (2012-06-28 10:14:21 UTC) #6
remyoudompheng
The refactoring introduced a bug I discovered while doing more extensive testing (printing of float32(1<<92)). ...
13 years, 11 months ago (2012-06-28 10:18:09 UTC) #7
remyoudompheng
Any more thoughts on this?
13 years, 11 months ago (2012-07-06 17:58:49 UTC) #8
r
LGTM
13 years, 11 months ago (2012-07-09 22:28:46 UTC) #9
remyoudompheng
*** Submitted as http://code.google.com/p/go/source/detail?r=695f65745351 *** strconv: extend Grisu3 algorithm to float32. Also improve extfloat.Normalize to ...
13 years, 11 months ago (2012-07-10 05:44:30 UTC) #10
remyoudompheng
13 years, 11 months ago (2012-07-10 05:51:30 UTC) #11
Ah, for some reason I missed the new test in atof_test.go, I will include it in
another patch.
Sign in to reply to this message.

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