-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeGarbageCollectorNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.PerformanceThinking
Milestone
Description
Hello,
Just like we have FormatFloat(...) string and AppendFloat(...) []byte, it would be nice
to avoid a costly string conversion when parsing numbers from a byteslice.
Simple code like:
func main() {
s := "123.45"
r := bytes.NewBufferString(s)
runtime.UpdateMemStats()
println(runtime.MemStats.Mallocs)
var v float64
fmt.Fscanf(r, "%f", &v)
runtime.UpdateMemStats()
println(runtime.MemStats.Mallocs)
}
says it's doing 7 allocations in the Scanf.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeGarbageCollectorNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.PerformanceThinking