[Bug ld/30724] cygwin ld performance regression since 014a602b86
https://sourceware.org/bugzilla/show_bug.cgi?id=30724 --- Comment #13 from Achim --- Thank you. Going forward I'd suggest you revisit why you need to turn around the same stream and if it might not be more efficient to just have a read and a write stream (really just append I assume) to the same file and a read barrier that follows the write pointer when flushed. -- You are receiving this mail because: You are on the CC list for the bug.
[Bug ld/30724] cygwin ld performance regression since 014a602b86
https://sourceware.org/bugzilla/show_bug.cgi?id=30724 Alan Modra changed: What|Removed |Added Target Milestone|--- |2.42 Resolution|--- |FIXED Status|ASSIGNED|RESOLVED --- Comment #12 from Alan Modra --- Fixed -- You are receiving this mail because: You are on the CC list for the bug.
[Bug ld/30724] cygwin ld performance regression since 014a602b86
https://sourceware.org/bugzilla/show_bug.cgi?id=30724 --- Comment #11 from cvs-commit at gcc dot gnu.org --- The binutils-2_41-branch branch has been updated by Alan Modra : https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=226f2e6b924612ecbdb7dfe4f3ca66ed77f4 commit 226f2e6b924612ecbdb7dfe4f3ca66ed77f4 Author: Alan Modra Date: Mon Aug 7 08:28:55 2023 +0930 PR30724, cygwin ld performance regression since 014a602b86 According to the reporter of this bug the newlib fseek implementation is likely slowed down by locking and fflush, only attempting to optimise seeks when the file is opened read-only. Thus when writing the output we get a dramatic slowdown due to commit 014a602b86. PR 30724 * bfd.c (enum bfd_last_io): New. (struct bfd): Add last_io field. * bfd-in2.h: Regenerate. * bfd-io.c (bfd_bread, bfd_bwrite): Force seek if last_io is opposite direction. (bfd_seek): Reinstate optimisation for seek to same position. (cherry picked from commit f82ee0c8dc4ee32556e23e6cd83ef083618f704f) -- You are receiving this mail because: You are on the CC list for the bug.
[Bug ld/30724] cygwin ld performance regression since 014a602b86
https://sourceware.org/bugzilla/show_bug.cgi?id=30724 --- Comment #10 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Alan Modra : https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f82ee0c8dc4ee32556e23e6cd83ef083618f704f commit f82ee0c8dc4ee32556e23e6cd83ef083618f704f Author: Alan Modra Date: Mon Aug 7 08:28:55 2023 +0930 PR30724, cygwin ld performance regression since 014a602b86 According to the reporter of this bug the newlib fseek implementation is likely slowed down by locking and fflush, only attempting to optimise seeks when the file is opened read-only. Thus when writing the output we get a dramatic slowdown due to commit 014a602b86. PR 30724 * bfd.c (enum bfd_last_io): New. (struct bfd): Add last_io field. * bfd-in2.h: Regenerate. * bfd-io.c (bfd_bread, bfd_bwrite): Force seek if last_io is opposite direction. (bfd_seek): Reinstate optimisation for seek to same position. -- You are receiving this mail because: You are on the CC list for the bug.
Re: [Bug ld/30724] cygwin ld performance regression since 014a602b86
amodra at gmail dot com writes: >> is that on Git somewhere? I can run a tests with it >> the upcoming weekend most likely. > No, the patch is not upstream anywhere yet, I'll wait for someone to test it > on > cygwin before committing. It applies with "git am" to either binutils master > or binutils-2_41-branch. I've just built binutils 2.41 on Cygwin with the patch applied and all seems well. Linking protobuf is within the measurement uncertainty of the previous build. The "objdump the gcc binaries" exercise is ever so slightly slower than with the other 2.41 builds and that time is spent in system, so it seems that there are indeed instances where an extra fflush gets inserted. No further findings so far, I'll install it and do a full build of gcc again tomorrow.
[Bug ld/30724] cygwin ld performance regression since 014a602b86
https://sourceware.org/bugzilla/show_bug.cgi?id=30724 --- Comment #9 from Alan Modra --- (In reply to Achim from comment #7) > is that on Git somewhere? I can run a tests with it > the upcoming weekend most likely. No, the patch is not upstream anywhere yet, I'll wait for someone to test it on cygwin before committing. It applies with "git am" to either binutils master or binutils-2_41-branch. -- You are receiving this mail because: You are on the CC list for the bug.
[Bug ld/30724] cygwin ld performance regression since 014a602b86
https://sourceware.org/bugzilla/show_bug.cgi?id=30724 Alan Modra changed: What|Removed |Added Attachment #15045|0 |1 is obsolete|| --- Comment #8 from Alan Modra --- Created attachment 15046 --> https://sourceware.org/bugzilla/attachment.cgi?id=15046=edit revised patch (In reply to Hannes Domani from comment #6) > Because last_io is never set to bfd_io_read or bfd_io_write. Oops, yes, there needs to be an obvious fix.. -- You are receiving this mail because: You are on the CC list for the bug.
[Bug ld/30724] cygwin ld performance regression since 014a602b86
https://sourceware.org/bugzilla/show_bug.cgi?id=30724 --- Comment #7 from Achim --- That patch certainly looks more thorough than just reverting the change that caused the regression… is that on Git somewhere? I can run a tests with it the upcoming weekend most likely. Btw, Cygwin and MinGW are two completely different things except for the executasble format. -- You are receiving this mail because: You are on the CC list for the bug.
[Bug ld/30724] cygwin ld performance regression since 014a602b86
https://sourceware.org/bugzilla/show_bug.cgi?id=30724 --- Comment #6 from Hannes Domani --- (In reply to Alan Modra from comment #5) > Created attachment 15045 [details] > reinstate seek optimisation Ist that the full patch? Because last_io is never set to bfd_io_read or bfd_io_write. -- You are receiving this mail because: You are on the CC list for the bug.
[Bug ld/30724] cygwin ld performance regression since 014a602b86
https://sourceware.org/bugzilla/show_bug.cgi?id=30724 --- Comment #5 from Alan Modra --- Created attachment 15045 --> https://sourceware.org/bugzilla/attachment.cgi?id=15045=edit reinstate seek optimisation I did wonder whether we'd need something like this when I removed the seek optimisation, which BTW was done for cygwin/mingw. See thread https://sourceware.org/pipermail/binutils/2023-May/127578.html -- You are receiving this mail because: You are on the CC list for the bug.
[Bug ld/30724] cygwin ld performance regression since 014a602b86
https://sourceware.org/bugzilla/show_bug.cgi?id=30724 Alan Modra changed: What|Removed |Added Summary|Massive ld performance |cygwin ld performance |regression in binutils-2.41 |regression since 014a602b86 |since | |014a602b86f08de96fc80ef3f96 | |a87db6cccad56 | Last reconfirmed||2023-08-06 Ever confirmed|0 |1 Target|cygwin | Assignee|unassigned at sourceware dot org |amodra at gmail dot com Status|UNCONFIRMED |ASSIGNED Host||cygwin -- You are receiving this mail because: You are on the CC list for the bug.