[go] runtime: replace sort.Slice with slices.Sort

5 views
Skip to first unread message

Kirill Kolyshkin (Gerrit)

unread,
Dec 17, 2025, 8:03:33 PM (2 days ago) Dec 17
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Kirill Kolyshkin has uploaded the change for review

Commit message

runtime: replace sort.Slice with slices.Sort

As suggested by go fix -slicessort.
Change-Id: I7b4b58d306415f67f0bbe727a93ed0550e50a059

Change diff

diff --git a/src/runtime/metrics_test.go b/src/runtime/metrics_test.go
index 148d7a2..e28eb9e 100644
--- a/src/runtime/metrics_test.go
+++ b/src/runtime/metrics_test.go
@@ -18,7 +18,6 @@
"runtime/pprof"
"runtime/trace"
"slices"
- "sort"
"strings"
"sync"
"sync/atomic"
@@ -463,9 +462,7 @@
b.ReportMetric(0, "allocs/op")

// Sort latencies then report percentiles.
- sort.Slice(latencies, func(i, j int) bool {
- return latencies[i] < latencies[j]
- })
+ slices.Sort(latencies)
b.ReportMetric(float64(latencies[len(latencies)*50/100]), "p50-ns")
b.ReportMetric(float64(latencies[len(latencies)*90/100]), "p90-ns")
b.ReportMetric(float64(latencies[len(latencies)*99/100]), "p99-ns")

Change information

Files:
  • M src/runtime/metrics_test.go
Change size: XS
Delta: 1 file changed, 1 insertion(+), 4 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I7b4b58d306415f67f0bbe727a93ed0550e50a059
Gerrit-Change-Number: 730970
Gerrit-PatchSet: 1
Gerrit-Owner: Kirill Kolyshkin <koly...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
Dec 18, 2025, 12:08:42 PM (23 hours ago) Dec 18
to Kirill Kolyshkin, goph...@pubsubhelper.golang.org, Dmitry Vyukov, Ian Lance Taylor, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Dmitry Vyukov, Ian Lance Taylor, Kirill Kolyshkin and Martin Möhrmann

Robert Griesemer voted

Auto-Submit+1
Code-Review+2
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Dmitry Vyukov
  • Ian Lance Taylor
  • Kirill Kolyshkin
  • Martin Möhrmann
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I7b4b58d306415f67f0bbe727a93ed0550e50a059
Gerrit-Change-Number: 730970
Gerrit-PatchSet: 1
Gerrit-Owner: Kirill Kolyshkin <koly...@gmail.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Kirill Kolyshkin <koly...@gmail.com>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Comment-Date: Thu, 18 Dec 2025 17:08:35 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Kirill Kolyshkin (Gerrit)

unread,
Dec 18, 2025, 8:07:08 PM (15 hours ago) Dec 18
to goph...@pubsubhelper.golang.org, Go LUCI, Robert Griesemer, Dmitry Vyukov, Ian Lance Taylor, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Dmitry Vyukov, Ian Lance Taylor, Martin Möhrmann and Robert Griesemer

Kirill Kolyshkin voted and added 1 comment

Votes added by Kirill Kolyshkin

Hold+1

1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Kirill Kolyshkin . resolved

Hold for Go 1.26 freeze.

Open in Gerrit

Related details

Attention is currently required from:
  • Dmitry Vyukov
  • Ian Lance Taylor
  • Martin Möhrmann
  • Robert Griesemer
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Holds
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedNo-Wait-Release
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I7b4b58d306415f67f0bbe727a93ed0550e50a059
Gerrit-Change-Number: 730970
Gerrit-PatchSet: 3
Gerrit-Owner: Kirill Kolyshkin <koly...@gmail.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Kirill Kolyshkin <koly...@gmail.com>
Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Robert Griesemer <g...@google.com>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Comment-Date: Fri, 19 Dec 2025 01:07:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages