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
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30170

Details

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