Alexander Musman
c7258178cd
cmd/compile: optimize small constant-sized MemEq
...
Add optimization patterns for MemEq with small constant sizes
(3-32 bytes). These patterns help to avoid runtime calls for
small sizes.
For sizes 3-16, combine two chunks loading and comparison.
For sizes 17-32, combine a 16-byte comparison with the remaining bytes.
This change may increase binary size slightly due to inline expansion,
but improves performance for code with many small memequals,
e.g. DecodehealingTracker benchmark on arm64:
shortname: minio
pkg: github.com/minio/minio/cmd
│ Orig.res │ Uexp.res │
│ sec/op │ sec/op vs base │
DecodehealingTracker-4 842.5n ± 1% 794.0n ± 3% -5.75% (p=0.000 n=10)
AppendMsgResyncTargetsInfo-4 8.472n ± 0% 8.472n ± 0% ~ (p=0.582 n=10)
DataUpdateTracker-4 2.856µ ± 2% 2.804µ ± 3% ~ (p=0.210 n=10)
MarshalMsgdataUsageCacheInfo-4 131.2n ± 1% 131.6n ± 2% ~ (p=0.494 n=10)
geomean 227.4n 223.2n -1.86%
│ Orig.res │ Uexp.res │
│ B/s │ B/s vs base │
DecodehealingTracker-4 352.0Mi ± 1% 373.5Mi ± 3% +6.10% (p=0.000 n=10)
AppendMsgResyncTargetsInfo-4 1.099Gi ± 0% 1.099Gi ± 0% ~ (p=0.183 n=10)
DataUpdateTracker-4 341.8Ki ± 3% 351.6Ki ± 3% ~ (p=0.286 n=10)
geomean 50.95Mi 52.46Mi +2.96%
Change-Id: If3d7e7395656d5f36e3ab303a71044293d17bc3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/688195
Reviewed-by: Keith Randall <khr@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
Reviewed-by: Keith Randall <khr@google.com >
2026-01-22 14:34:09 -08:00
..
2023-10-19 23:33:25 +00:00
2023-06-16 17:08:43 +00:00
2022-01-10 21:27:19 +00:00
2021-07-14 23:33:46 +00:00
2024-11-22 02:04:41 +00:00
2022-03-24 02:14:15 +00:00
2026-01-22 14:34:09 -08:00
2026-01-15 15:10:27 -08:00
2022-09-27 21:10:19 +00:00
2023-03-28 14:28:33 +00:00
2024-09-17 17:01:20 +00:00
2024-07-23 19:05:35 +00:00
2025-10-29 11:00:23 -07:00
2022-03-24 17:50:47 +00:00
2024-06-07 15:22:22 +00:00
2021-12-13 22:42:08 +00:00
2025-12-08 13:57:44 -08:00
2024-03-25 19:21:35 +00:00
2024-11-14 02:14:13 +00:00
2025-12-30 07:28:53 -08:00
2025-12-29 11:21:12 -08:00
2025-10-06 16:01:40 -07:00
2024-10-23 04:43:01 +00:00
2022-09-28 22:28:39 +00:00
2021-10-30 18:30:05 +00:00
2024-11-18 18:52:54 +00:00
2025-12-02 16:56:58 -08:00
2023-10-19 23:33:25 +00:00
2025-10-29 18:49:40 -07:00
2023-01-31 19:43:07 +00:00
2023-03-06 18:34:24 +00:00
2023-10-19 23:33:25 +00:00
2025-12-29 12:17:32 -08:00
2025-03-11 05:44:15 -07:00
2023-04-11 20:56:32 +00:00
2022-06-28 18:11:31 +00:00
2022-09-08 15:55:44 +00:00
2022-09-19 18:58:26 +00:00
2025-10-14 15:09:35 -07:00
2025-10-09 08:23:21 -07:00
2022-11-17 13:46:05 +00:00
2025-03-10 21:30:51 -07:00
2022-09-28 22:28:39 +00:00
2024-07-29 14:30:07 +00:00
2025-10-29 11:00:23 -07:00
2021-08-09 16:10:20 +00:00
2025-10-08 14:09:22 -07:00
2025-10-08 14:09:22 -07:00
2025-10-14 09:33:37 -07:00
2022-09-02 06:22:23 +00:00
2022-09-02 06:22:23 +00:00
2023-05-12 12:34:59 +00:00
2025-05-19 16:14:53 -07:00
2025-05-19 16:14:53 -07:00
2024-07-22 21:27:37 +00:00
2025-05-21 12:02:43 -07:00
2025-04-04 15:04:34 -07:00
2025-11-26 19:04:05 -08:00
2025-02-19 13:38:58 -08:00
2025-05-19 16:14:53 -07:00
2024-07-22 21:27:37 +00:00
2021-07-28 21:41:07 +00:00
2025-05-21 12:24:22 -07:00
2025-05-21 12:02:43 -07:00
2025-10-02 11:02:07 -07:00
2025-05-19 16:14:53 -07:00
2023-08-18 11:58:37 +00:00
2024-09-18 20:57:20 +00:00
2024-03-25 19:53:03 +00:00
2025-05-19 16:14:53 -07:00
2025-05-21 20:07:36 -07:00
2022-09-07 17:25:59 +00:00
2023-03-06 18:34:24 +00:00
2023-11-16 05:48:00 +00:00
2021-12-03 16:24:32 +00:00
2023-07-10 16:36:41 +00:00
2024-09-30 22:04:40 +00:00
2024-08-07 16:07:55 +00:00
2023-10-19 23:33:25 +00:00
2025-10-29 11:00:23 -07:00
2026-01-22 12:57:37 -08:00
2022-09-27 21:10:19 +00:00
2022-01-11 02:26:58 +00:00
2022-09-23 20:27:09 +00:00
2022-11-16 04:04:52 +00:00
2022-01-11 02:26:58 +00:00
2024-10-22 22:20:29 +00:00
2023-08-18 11:58:37 +00:00
2025-05-19 16:14:53 -07:00
2023-10-19 23:33:25 +00:00
2025-04-22 08:28:13 -07:00
2025-03-06 10:07:17 -08:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2024-05-15 19:27:25 +00:00
2024-06-07 15:22:22 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2025-07-30 11:47:14 -07:00
2026-01-13 09:52:54 -08:00
2023-10-19 23:33:25 +00:00
2026-01-13 09:52:54 -08:00
2025-11-24 15:49:12 -08:00
2024-04-04 14:29:45 +00:00
2025-12-29 12:17:32 -08:00
2023-10-19 23:33:25 +00:00
2021-11-05 00:52:06 +00:00
2022-09-27 21:59:19 +00:00
2022-01-10 22:48:40 +00:00
2026-01-20 13:48:41 -08:00
2025-03-06 10:07:17 -08:00
2022-06-30 18:41:59 +00:00
2023-10-19 23:33:25 +00:00
2025-09-19 07:13:32 -07:00
2025-09-19 07:13:32 -07:00
2025-09-19 07:13:32 -07:00
2023-10-19 23:33:25 +00:00
2025-05-12 11:05:28 -07:00
2023-04-14 17:57:36 +00:00
2025-10-07 08:21:14 -07:00
2023-08-22 19:18:21 +00:00
2023-10-19 23:33:25 +00:00
2025-05-08 10:18:37 -07:00
2025-10-29 11:00:23 -07:00
2025-11-21 12:37:30 -08:00
2025-10-29 18:49:40 -07:00
2025-03-11 20:17:36 -07:00
2025-12-04 08:13:28 -08:00
2025-07-29 12:44:58 -07:00
2023-12-01 17:20:08 +00:00
2025-07-29 12:44:58 -07:00
2025-07-29 12:44:58 -07:00
2023-05-12 17:18:08 +00:00
2023-10-19 23:33:25 +00:00
2021-10-26 14:24:17 +00:00
2021-07-22 17:48:41 +00:00
2023-04-19 14:07:00 +00:00
2021-12-03 16:24:32 +00:00
2022-04-07 17:19:55 +00:00
2023-10-19 23:33:25 +00:00
2025-12-08 13:57:44 -08:00
2025-12-08 13:57:44 -08:00
2025-12-29 11:19:28 -08:00
2024-11-14 02:14:13 +00:00
2022-09-24 17:04:15 +00:00
2022-07-19 23:30:49 +00:00
2025-06-04 08:27:44 -07:00
2025-02-13 14:07:47 -08:00
2022-01-11 02:26:58 +00:00
2022-09-23 20:27:09 +00:00
2022-09-27 21:10:19 +00:00
2021-11-12 22:20:51 +00:00
2025-11-13 16:57:31 -08:00
2022-04-21 18:06:38 +00:00
2022-08-31 17:15:15 +00:00
2022-08-31 17:15:15 +00:00
2022-08-31 17:15:15 +00:00
2022-08-31 17:15:15 +00:00
2025-09-23 13:12:12 -07:00
2024-11-11 17:11:50 +00:00
2024-08-09 20:07:54 +00:00
2024-10-28 13:27:58 +00:00
2025-02-06 13:16:59 -08:00
2021-08-23 19:46:36 +00:00
2021-10-06 15:53:04 +00:00
2023-04-28 18:35:43 +00:00