Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v.util: fix the performance of v test-cleancode, when a slower diff tool is installed #21447

Conversation

spytheman
Copy link
Member

@spytheman spytheman commented May 6, 2024

Using a constant meant that the diff tools were always found, even if they were not used.

That added some milliseconds, to the start time of programs that used v.util.diff, like v fmt or v test-cleancode.

Changing available_tool to be a function, allows it to delay, and cache the invocation of the slower find_working_diff_tool, until it is actually needed (which may be never).

@spytheman spytheman changed the title v.util: fix performance with v test-cleancode, when a slower diff tool is installed v.util: fix the performance of v test-cleancode, when a slower diff tool is installed May 6, 2024
@spytheman spytheman merged commit 3563b58 into vlang:master May 6, 2024
69 checks passed
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.

1 participant