Skip to content

Implement experimental dc-glob backend for Nushell (Devyn's glob experiment) - #18109

Merged
cptpiepmatz merged 20 commits into
nushell:mainfrom
fdncred:dc-glob-integration
Jun 8, 2026
Merged

cptpiepmatz merged 20 commits into
nushell:mainfrom
fdncred:dc-glob-integration

Conversation

@fdncred

@fdncred fdncred commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR aims to replace nu-glob and wax with Devyn's glob-experiment. I implemented this as an experimental feature named dc-glob (devyn cairns glob). It was a very tricky PR since every command that touches globs (just about) had to be updated. This globbing should stream well but I anticipate corner issues since it's so heavily used.

The goal is to remove wax and nu-glob and standardize on something that works on all platforms. Time will tell if this is it.

Here's a couple hyperfine benchmarks.

Hyperfine with glob **/*.rs in the nushell repo

❯ hyperfine --warmup 5 --runs 20 "./target/release/nu --experimental-options dc-glob=false -c 'glob **/*.rs | length'" "./target/release/nu --experimental-options dc-glob=true -c 'glob **/*.rs | length'"
Benchmark 1: ./target/release/nu --experimental-options dc-glob=false -c 'glob **/*.rs | length'
  Time (mean ± σ):     660.7 ms ±   6.1 ms    [User: 285.8 ms, System: 373.4 ms]
  Range (min … max):   653.0 ms … 682.0 ms    20 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Benchmark 2: ./target/release/nu --experimental-options dc-glob=true -c 'glob **/*.rs | length'
  Time (mean ± σ):     507.4 ms ±   4.2 ms    [User: 193.7 ms, System: 444.3 ms]
  Range (min … max):   499.9 ms … 515.6 ms    20 runs

Summary
  ./target/release/nu --experimental-options dc-glob=true -c 'glob **/*.rs | length' ran
    1.30 ± 0.02 times faster than ./target/release/nu --experimental-options dc-glob=false -c 'glob **/*.rs | length'

Hyperfine with ls **/*.rs in the nushell repo

❯ hyperfine --warmup 5 --runs 20 "./target/release/nu --experimental-options dc-glob=false -c 'ls **/*.rs | length'" "./target/release/nu --experimental-options dc-glob=true -c 'ls **/*.rs | length'"
Benchmark 1: ./target/release/nu --experimental-options dc-glob=false -c 'ls **/*.rs | length'
  Time (mean ± σ):      2.358 s ±  0.032 s    [User: 0.612 s, System: 1.747 s]
  Range (min … max):    2.319 s …  2.459 s    20 runs

Benchmark 2: ./target/release/nu --experimental-options dc-glob=true -c 'ls **/*.rs | length'
  Time (mean ± σ):     488.5 ms ±  15.7 ms    [User: 170.2 ms, System: 461.4 ms]
  Range (min … max):   476.9 ms … 539.0 ms    20 runs

Summary
  ./target/release/nu --experimental-options dc-glob=true -c 'ls **/*.rs | length' ran
    4.83 ± 0.17 times faster than ./target/release/nu --experimental-options dc-glob=false -c 'ls **/*.rs | length'

Tango Benchmarks

❯ cargo bench --bench benchmarks -- solo --filter '*recursive*'
ls_recursive_legacy                                 [  35.6 ms ...  36.2 ms ...  36.9 ms ]  stddev: 666.1 us
ls_recursive_dc                                     [  13.7 ms ...  14.4 ms ...  14.9 ms ]  stddev: 396.4 us
glob_recursive_legacy_wax                           [  15.6 ms ...  15.8 ms ...  16.1 ms ]  stddev: 188.4 us
glob_recursive_dc_glob                              [   6.1 ms ...   6.8 ms ...  10.3 ms ]  stddev:   1.0 ms

User-facing changes (Release notes)

There is a new experimental feature named dc-glob (named for devyn cairns glob). The goal is to remove our existing globbing crates and standardize on something that works on all platforms. Time will tell if this is it. It seems pretty fast. To enable it just launch nushell with nu --experimental-options dc-glob=true or set your environment variable BEFORE nushell launches like NU_EXPERIMENTAL_OPTIONS=all or NU_EXPERIMENTAL_OPTIONS=dc-glob=true if you only want to try this one.

Additional notes

tracking #18101

@github-actions github-actions Bot added the A:LSP Language Server Protocol (nu-lsp) label Apr 23, 2026
@cptpiepmatz
cptpiepmatz self-requested a review April 24, 2026 12:05
@fdncred

fdncred commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@cptpiepmatz I see you wanted to review this one too. Take a look when you get a chance. I'm ready to land it and play with it more.

Comment thread crates/nu-engine/src/glob_from.rs Resolved
Comment thread crates/nu-command/tests/commands/cd.rs Resolved
Comment thread crates/nu-engine/Cargo.toml Resolved
@fdncred

fdncred commented May 20, 2026 •

Copy link
Copy Markdown
Contributor Author

I think I've addressed all your concerns @cptpiepmatz

@cptpiepmatz cptpiepmatz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, totally forgot to approve your PR here.

@cptpiepmatz cptpiepmatz added notes:ready Indicates Ready for Release notes and removed A:LSP Language Server Protocol (nu-lsp) labels Jun 8, 2026
@cptpiepmatz cptpiepmatz added the notes:additions Noted in "Additions" section label Jun 8, 2026
@cptpiepmatz
cptpiepmatz merged commit 5efa545 into nushell:main Jun 8, 2026
18 checks passed
@github-actions github-actions Bot added this to the v0.114.0 milestone Jun 8, 2026
@fdncred
fdncred deleted the dc-glob-integration branch June 8, 2026 14:49
@fdncred

fdncred commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

🤞🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:additions Noted in "Additions" section notes:ready Indicates Ready for Release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants