Skip to content

bbmain: faster ResolveUntilLastSymlink#128

Open
dolmen wants to merge 1 commit intou-root:mainfrom
dolmen-go:bbmain-simplify-ResolveUntilLastSymlink
Open

bbmain: faster ResolveUntilLastSymlink#128
dolmen wants to merge 1 commit intou-root:mainfrom
dolmen-go:bbmain-simplify-ResolveUntilLastSymlink

Conversation

@dolmen
Copy link
Copy Markdown

@dolmen dolmen commented Mar 24, 2025

In the main package of gobusybox binaries, reduce redundant calls to AbsSymlink in ResolveUntilLastSymlink.

This reduces string manipulations when resolving symlinks of os.Argv[0].

Reduce redundant calls to AbsSymlink in ResolveUntilLastSymlink.
Copy link
Copy Markdown
Member

@rminnich rminnich left a comment

Choose a reason for hiding this comment

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

This may well be an improvement but in the most common case, there is one symlink. In the outlier case there are 2. I'm not sure the performance benefit is worth the additional complexity.

@rminnich
Copy link
Copy Markdown
Member

I do hope my review does not discourage you from contributing, I had not looked at the PRs for a while (I will do so more frequently) and missed this one.

I wonder if you could look at the many places in this tree that the go version is specified as go 1. and see if they should be brought up to date?

If you want to continue with this PR, I think we need more tests. This is code that must never break, as it is the core of the runtime, and I get worried about too much complexity.

Thank you.

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