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

Issue 5369111: code review 5369111: strconv: make Ftoa faster (Closed)

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

Description

strconv: make Ftoa faster Make code amenable to escape analysis so that the decimal values do not escape. benchmark old ns/op new ns/op delta strconv_test.BenchmarkAtof64Decimal 229 233 +1.75% strconv_test.BenchmarkAtof64Float 261 263 +0.77% strconv_test.BenchmarkAtof64FloatExp 7760 7757 -0.04% strconv_test.BenchmarkAtof64Big 3086 3053 -1.07% strconv_test.BenchmarkFtoa64Decimal 6866 2629 -61.71% strconv_test.BenchmarkFtoa64Float 7211 3064 -57.51% strconv_test.BenchmarkFtoa64FloatExp 12587 8263 -34.35% strconv_test.BenchmarkFtoa64Big 7058 2825 -59.97% json.BenchmarkCodeEncoder 357355200 276528200 -22.62% json.BenchmarkCodeMarshal 360735200 279646400 -22.48% json.BenchmarkCodeDecoder 731528600 709460600 -3.02% json.BenchmarkCodeUnmarshal 754774400 731051200 -3.14% json.BenchmarkCodeUnmarshalReuse 713379000 704218000 -1.28% json.BenchmarkSkipValue 51594300 51682600 +0.17% benchmark old MB/s new MB/s speedup json.BenchmarkCodeEncoder 5.43 7.02 1.29x json.BenchmarkCodeMarshal 5.38 6.94 1.29x json.BenchmarkCodeDecoder 2.65 2.74 1.03x json.BenchmarkCodeUnmarshal 2.57 2.65 1.03x json.BenchmarkCodeUnmarshalReuse 2.72 2.76 1.01x json.BenchmarkSkipValue 38.61 38.55 1.00x

Patch Set 1 #

Patch Set 2 : diff -r 46d308546a72 https://go.googlecode.com/hg #

Patch Set 3 : diff -r 2186073bfe4e https://go.googlecode.com/hg #

Patch Set 4 : diff -r 14a037cbc719 https://go.googlecode.com/hg #

Patch Set 5 : diff -r 14a037cbc719 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -24 lines) Patch
M src/pkg/strconv/decimal.go View 1 4 chunks +10 lines, -17 lines 0 comments Download
M src/pkg/strconv/decimal_test.go View 1 1 chunk +9 lines, -3 lines 0 comments Download
M src/pkg/strconv/ftoa.go View 1 3 chunks +6 lines, -3 lines 0 comments Download
M src/pkg/strconv/internal_test.go View 1 2 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 3
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg
12 years, 5 months ago (2011-11-15 16:02:53 UTC) #1
r
LGTM
12 years, 5 months ago (2011-11-15 16:10:47 UTC) #2
rsc
12 years, 5 months ago (2011-11-15 17:17:29 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=d29fa3306eaf ***

strconv: make Ftoa faster

Make code amenable to escape analysis
so that the decimal values do not escape.

benchmark                               old ns/op    new ns/op    delta
strconv_test.BenchmarkAtof64Decimal           229          233   +1.75%
strconv_test.BenchmarkAtof64Float             261          263   +0.77%
strconv_test.BenchmarkAtof64FloatExp         7760         7757   -0.04%
strconv_test.BenchmarkAtof64Big              3086         3053   -1.07%
strconv_test.BenchmarkFtoa64Decimal          6866         2629  -61.71%
strconv_test.BenchmarkFtoa64Float            7211         3064  -57.51%
strconv_test.BenchmarkFtoa64FloatExp        12587         8263  -34.35%
strconv_test.BenchmarkFtoa64Big              7058         2825  -59.97%
json.BenchmarkCodeEncoder               357355200    276528200  -22.62%
json.BenchmarkCodeMarshal               360735200    279646400  -22.48%
json.BenchmarkCodeDecoder               731528600    709460600   -3.02%
json.BenchmarkCodeUnmarshal             754774400    731051200   -3.14%
json.BenchmarkCodeUnmarshalReuse        713379000    704218000   -1.28%
json.BenchmarkSkipValue                  51594300     51682600   +0.17%

benchmark                                old MB/s     new MB/s  speedup
json.BenchmarkCodeEncoder                    5.43         7.02    1.29x
json.BenchmarkCodeMarshal                    5.38         6.94    1.29x
json.BenchmarkCodeDecoder                    2.65         2.74    1.03x
json.BenchmarkCodeUnmarshal                  2.57         2.65    1.03x
json.BenchmarkCodeUnmarshalReuse             2.72         2.76    1.01x
json.BenchmarkSkipValue                     38.61        38.55    1.00x

R=golang-dev, r
CC=golang-dev
http://codereview.appspot.com/5369111
Sign in to reply to this message.

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