Skip to content

[perf][P2] glob per-file match + sort residual (4.1x after #664) #681

Closed

Description

@caomengxuan666

Follow-up of #664 (PR #674 fixed bare-** global ordering only; correctness slice). Remaining per the #619 split recon: (a) src/executor/glob.rs:320 glob_vector_expand per-candidate chars().collect() staging (-> slice-match on &str/bytes, same class as #281); (b) strcoll_posixcmp per-comparison sort (byte-order under C/POSIX, strcoll only under live non-C locale). GNU: lib/glob/glob.c:641 glob_vector byte-domain match, pathexp.c:881 qsort globsort_namecmp / :917 sh_sortglob. Bench: perf_battery 27_glob (300 files) with match/sort/store split table + LC_COLLATE=C vs active matrix. Risks: dotfiles/GLOBIGNORE/casefold/extglob, nullglob/failglob; goldens mx-glob-nomatch mx-globstar issue316_*.

Activity

  1. caomengxuan666 commented on Oct 16, 2026

    @caomengxuan666
    MemberAuthor

    Slice (a) up as PR #685 (branch perf/issue681-glob-perfile): scratch reuse + in-place alt subslice; sort untouched. Matcher-heavy -12%/-20%; battery 34/34. Gate running.

  2. caomengxuan666 commented on Oct 16, 2026

    @caomengxuan666
    MemberAuthor

    Slice (a) landed as #685 (squash-merged 0d556e0). Matcher-heavy -12%/-20%; battery 34/34; gates identical (niu 49=49). Slice (b) sort stays open here.

  3. caomengxuan666 commented on Oct 17, 2026

    @caomengxuan666
    MemberAuthor

    Slice (b) up as PR #689 (branch perf/issue681-glob-sort): one locale resolution per sort; byte order under C, host collation otherwise (result-identical). LC_ALL=C 300-file loop -22%; default locale unchanged by design. Batteries 34/34 in both locales. Gate running.

  4. caomengxuan666 commented on Oct 17, 2026

    @caomengxuan666
    MemberAuthor

    Both slices landed: #685 match staging, #689 sort hoist (LC_ALL=C -22%). Battery 34/34 in both locales; gates identical (niu 8=8).

  5. added
    performance
    P2-medium
    area:glob
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-mediumarea:globperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions