mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-05 04:16:15 +02:00
[PERF] PromQL: Replace Fprintf %f with AppendFloat
The combination of `AvailableBuffer`` followed by `Write` is optimised inside `bytes.Buffer`. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
b8d2d505f5
commit
153cdb2b0b
@ -373,7 +373,7 @@ func (node *VectorSelector) String() string {
|
||||
switch {
|
||||
case node.Timestamp != nil:
|
||||
b.WriteString(" @ ")
|
||||
fmt.Fprintf(b, "%.3f", float64(*node.Timestamp)/1000.0)
|
||||
b.Write(strconv.AppendFloat(b.AvailableBuffer(), float64(*node.Timestamp)/1000.0, 'f', 3, 64))
|
||||
case node.StartOrEnd == START:
|
||||
b.WriteString(" @ start()")
|
||||
case node.StartOrEnd == END:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user