Skip to content

Commit fc6a49f

Browse files
committed
encoding/json: remove comment about performance of scanner.step
In an experiment I could not reproduce the 10% performance loss when using an integer constant for scanner.step. Instead the performance seemed to be about the same or slightly better than before.
1 parent 7ee3b63 commit fc6a49f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/encoding/json/scanner.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ func (e *SyntaxError) Error() string { return e.msg }
6363
// the beginning of 12345e+6?).
6464
type scanner struct {
6565
// The step is a func to be called to execute the next transition.
66-
// Also tried using an integer constant and a single func
67-
// with a switch, but using the func directly was 10% faster
68-
// on a 64-bit Mac Mini, and it's nicer to read.
66+
// Also tried using an integer constant and a single func with a
67+
// switch, but this is nicer to read.
6968
step func(*scanner, byte) int
7069

7170
// Reached end of top-level value.

0 commit comments

Comments
 (0)