Repository navigation
Borrow normalized paths during file URL conversion - #22559
Conversation
`VerbatimUrl` path constructors already own the normalized path but clone it before passing it to `DisplaySafeUrl::from_file_path`, which only needs a borrowed path. Borrow it for conversion and move it into the conversion error when needed, avoiding those temporary path copies. Co-authored-by: zaniebot <[email protected]>
Merging this PR will regress 1 benchmark
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ |
discover_workspace_from_all_members_with_excludes |
148.2 ms | 164.2 ms | -9.72% |
| ⚡ | from_hex/uppercase[48] |
336.9 µs | 315.9 µs | +6.64% |
| ⚡ |
discover_workspace_from_all_members |
148.8 ms | 140.6 ms | +5.89% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing zb/opportunity-07-09-borrow-url-paths (b6e3aa7) with main (1310268)2
Footnotes
-
80 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(725b74b) during the generation of this report, so 1310268 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
VerbatimUrlpath constructors already own the normalized path but clone it before passing it toDisplaySafeUrl::from_file_path, which only needs a borrowed path. Borrow it for conversion and move it into the conversion error when needed, avoiding those temporary path copies.