HomeFreeBSD

sort: Cache value of MB_CUR_MAX

Description

sort: Cache value of MB_CUR_MAX

Every usage of MB_CUR_MAX results in a call to __mb_cur_max. This is
inefficient and redundant. Caching the value of MB_CUR_MAX in a global
variable removes these calls and speeds up the runtime of sort. For
numeric sorting, runtime is almost halved in some tests.

PR: 255551
PR: 255840
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30170

(cherry picked from commit 71ec05a21257e159f40d54e26ad0011bb19b5134)

Details

Provenance
cyril_freebsdfoundation.orgAuthored on May 13 2021, 12:55 PM
markjCommitted on May 20 2021, 1:15 PM
Reviewer
markj
Differential Revision
D30170: sort: Cache value of MB_CUR_MAX
Parents
rGf80d1c0035ce: sort: Stop "fixing" obsolete key syntax after -- flag
Branches
Unknown
Tags
Unknown