-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
os: Open() makes two system call to open a file on windows #7426
Labels
Milestone
Comments
Labels changed: added repo-main, release-go1.3maybe, os-windows. Owner changed to @alexbrainman. Status changed to Accepted. |
patrick, It sounds reasonable to change, but can you actually demonstrate your point with some statistical data. Can you change some large program that uses many files (cmd/go or godoc or ...) to count "failed syscalls" for both scenarios (open file first against open directory first), and tell us what the difference is. You should consider syscall is "failed" if openDir failed while openFile succeeds. Thank you Alex |
I added Stderr.Write([]byte("...")) before every return and between the two calls. Then built everything again and ran "go install -a std" a couple of times for both configurations, piping to "sort | uniq -c". The results, reordered by code flow. Before: ----- 547 openDir succeeded 3593 openDir failed and fell back to openFile 3592 openFile succeeded 1 both failed After: ---- 3592 openFile succeeded 548 openFile failed and fell back 547 openDir succeeded 1 both failed So, it trades 3593 failed openDir for 548 failed openFile. |
Patrick, Looks good to me. Please send your change as described here http://golang.org/doc/contribute.html#Code_review. Thank you. Alex |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: