According to a profiling data from a large number of servers at Google, strings.Fields is within the top 50 functions by CPU time. The current implementation simply calls strings.FieldsFunc(s, unicode.IsSpace). We should consider writing a specialized version without calling unicode.IsSpace. Also, we should should optimize for the fact that ASCII whitespace is by far the most common delimiter.
The same optimization can be applied to the bytes package as well to keep them in sync.
According to a profiling data from a large number of servers at Google,
strings.Fieldsis within the top 50 functions by CPU time. The current implementation simply callsstrings.FieldsFunc(s, unicode.IsSpace). We should consider writing a specialized version without callingunicode.IsSpace. Also, we should should optimize for the fact that ASCII whitespace is by far the most common delimiter.The same optimization can be applied to the
bytespackage as well to keep them in sync.