Sitelet https://github.com/belav/csharpier/pull/1758
Skip to content

perf: cache IgnoreWithBasePath - #1758

Merged
belav merged 2 commits into
belav:mainfrom
TimothyMakkison:cache_ignores
Dec 25, 2025
Merged

belav merged 2 commits into
belav:mainfrom
TimothyMakkison:cache_ignores

Conversation

@TimothyMakkison

@TimothyMakkison TimothyMakkison commented Nov 15, 2025 •

Copy link
Copy Markdown
Contributor

Repeatedly compiling regex for ignore files is a significant amount of runtime, caches the IgnoreWithBasePath to prevent this. See also #1776

Before

Method Mean Error StdDev Gen0 Gen1 Allocated
FormatCli 955.0 ms 17.65 ms 29.98 ms 9000.0000 1000.0000 81.5 MB

After

Method Mean Error StdDev Gen0 Allocated
FormatCli 683.5 ms 13.61 ms 30.17 ms 7000.0000 69.33 MB

@TimothyMakkison

TimothyMakkison commented Dec 14, 2025 •

Copy link
Copy Markdown
Contributor Author

Rebase after #1768

Before

Method Mean Error StdDev Gen0 Allocated
FormatCli 1.185 s 0.0228 s 0.0476 s 7000.0000 64.06 MB

After

Method Mean Error StdDev Median Gen0 Allocated
FormatCli 553.2 ms 11.01 ms 29.39 ms 542.0 ms 5000.0000 52.53 MB

@TimothyMakkison
TimothyMakkison force-pushed the cache_ignores branch 2 times, most recently from a65ef16 to 2142ea5 Compare December 14, 2025 22:01

@belav belav left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks good!

@belav belav added this to the 1.3.0 milestone Dec 25, 2025
@belav
belav enabled auto-merge (squash) December 25, 2025 17:00
@belav
belav merged commit 4ba7b8f into belav:main Dec 25, 2025
7 checks passed
belav added a commit that referenced this pull request Dec 31, 2025
Repeatedly compiling regex for ignore files is a significant amount of
runtime, caches the `IgnoreWithBasePath` to prevent this. See also #1776


### Before
| Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated |
|----------
|---------:|---------:|---------:|----------:|----------:|----------:|
| FormatCli | 955.0 ms | 17.65 ms | 29.98 ms | 9000.0000 | 1000.0000 |
81.5 MB |


### After

| Method    | Mean     | Error    | StdDev   | Gen0      | Allocated |
|---------- |---------:|---------:|---------:|----------:|----------:|
| FormatCli | 683.5 ms | 13.61 ms | 30.17 ms | 7000.0000 |  69.33 MB |

Co-authored-by: Bela VanderVoort <twobitbela@gmail.com>
belav added a commit that referenced this pull request Feb 20, 2026
Repeatedly compiling regex for ignore files is a significant amount of
runtime, caches the `IgnoreWithBasePath` to prevent this. See also #1776


### Before
| Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated |
|----------
|---------:|---------:|---------:|----------:|----------:|----------:|
| FormatCli | 955.0 ms | 17.65 ms | 29.98 ms | 9000.0000 | 1000.0000 |
81.5 MB |


### After

| Method    | Mean     | Error    | StdDev   | Gen0      | Allocated |
|---------- |---------:|---------:|---------:|----------:|----------:|
| FormatCli | 683.5 ms | 13.61 ms | 30.17 ms | 7000.0000 |  69.33 MB |

Co-authored-by: Bela VanderVoort <twobitbela@gmail.com>
belav added a commit that referenced this pull request Mar 12, 2026
Repeatedly compiling regex for ignore files is a significant amount of
runtime, caches the `IgnoreWithBasePath` to prevent this. See also #1776


### Before
| Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated |
|----------
|---------:|---------:|---------:|----------:|----------:|----------:|
| FormatCli | 955.0 ms | 17.65 ms | 29.98 ms | 9000.0000 | 1000.0000 |
81.5 MB |


### After

| Method    | Mean     | Error    | StdDev   | Gen0      | Allocated |
|---------- |---------:|---------:|---------:|----------:|----------:|
| FormatCli | 683.5 ms | 13.61 ms | 30.17 ms | 7000.0000 |  69.33 MB |

Co-authored-by: Bela VanderVoort <twobitbela@gmail.com>
belav added a commit that referenced this pull request Apr 4, 2026
Repeatedly compiling regex for ignore files is a significant amount of
runtime, caches the `IgnoreWithBasePath` to prevent this. See also #1776


### Before
| Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated |
|----------
|---------:|---------:|---------:|----------:|----------:|----------:|
| FormatCli | 955.0 ms | 17.65 ms | 29.98 ms | 9000.0000 | 1000.0000 |
81.5 MB |


### After

| Method    | Mean     | Error    | StdDev   | Gen0      | Allocated |
|---------- |---------:|---------:|---------:|----------:|----------:|
| FormatCli | 683.5 ms | 13.61 ms | 30.17 ms | 7000.0000 |  69.33 MB |

Co-authored-by: Bela VanderVoort <twobitbela@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants