Skip to content

[flang][runtime] Formatted input optimizations #134715

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

Merged
merged 1 commit into from
Apr 10, 2025
Merged

Conversation

klausler
Copy link
Contributor

@klausler klausler commented Apr 7, 2025

Make some minor tweaks (inlining, caching) to the formatting input path to improve integer input in a SPEC code. (None of the I/O library has been tuned yet for performance, and there are some easy optimizations for common cases.) Input integer values are now calculated with native C/C++ 128-bit integers.

A benchmark that only reads about 5M lines of three integer values each speeds up from over 8 seconds to under 3 in my environment with these changeds.

If this works out, the code here can be used to optimize the formatted input paths for real and character data, too.

Fixes #134026.

@llvmbot llvmbot added the flang Flang issues not falling into any other category label Apr 7, 2025
@s-watanabe314
Copy link
Contributor

I'm sorry, I can't review the code because I'm not familiar with it. However, as I mentioned in #134026, I confirmed that this patch improves performance.

Make some minor tweaks (inlining, caching) to the formatting input
path to improve integer input in a SPEC code.  (None of the I/O
library has been tuned yet for performance, and there are some
easy optimizations for common cases.)  Input integer values are
now calculated with native C/C++ 128-bit integers.

A benchmark that only reads about 5M lines of three integer values each
speeds up from over 8 seconds to under 3 in my environment with these
changeds.

If this works out, the code here can be used to optimize the formatted
input paths for real and character data, too.

Fixes llvm#134026.
@klausler klausler merged commit 18fe012 into llvm:main Apr 10, 2025
11 checks passed
@klausler klausler deleted the bug134026 branch April 10, 2025 16:56
var-const pushed a commit to ldionne/llvm-project that referenced this pull request Apr 17, 2025
Make some minor tweaks (inlining, caching) to the formatting input path
to improve integer input in a SPEC code. (None of the I/O library has
been tuned yet for performance, and there are some easy optimizations
for common cases.) Input integer values are now calculated with native
C/C++ 128-bit integers.

A benchmark that only reads about 5M lines of three integer values each
speeds up from over 8 seconds to under 3 in my environment with these
changeds.

If this works out, the code here can be used to optimize the formatted
input paths for real and character data, too.

Fixes llvm#134026.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flang] read statement is slower than Gfortran in SPEC CPU 2017
4 participants