-
Notifications
You must be signed in to change notification settings - Fork 112
Expand tabs when parsing for USE, INCLUDE, MODULE statements #510
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together quickly @urbanjost! The implementation all looks good to me, but I have a question about performance: do you have any rough idea whether this adds much overhead to reading the source files?
The short answer is that using the general-purpose-fortran package as a test, with 1136 source files and around 282 000, lines of source it is noise level. During a full rebuild the time is so dominated by the calls to system commands (particularly the compiler) the time in the program is insignificant, so the timing only becomes significant during a build or run|test of something essentially already built. In those cases it adds less than 1/10 of a second. There is room, as the OP (Original Poster) noted, to combine the adjustl/lower/notabs ops at the time of reading the file, possibly removing full comment lines or lines not containing any of the keywords; with the hash having to be done first or seperately. The fpm time itself is most noticeable at a human level when doing repeated "fpm run" commands; but the system commands searching for the files still dominate that time. Optimizing would be fruitful but also having a switch on run that bypasses the rebuild would probably be more effective at a macro level; like earlier versions did before the auto-build. But assuming you commonly want the rebuild and would install the apps the impact of speeding up fpm would be most felt when running many tests or executables at once. I did not check but I assume the rebuild check only occurs once. If it happens for each executable invocation that would add up. That just occurred to me, and easy to check. I had not profiled everything for a while as performance has been quite satisfactory for my usage patterns; I will take a better look. I have quite a bit of profiling runs built in to some tests, and profiling numbers always have to be read aware of how cache affects I/O, and so on. But at least on Linux it added very little time. So no one should read too much into the following gprof output of a build when everything is up to date except that the average real time barely changed (and was actually slightly faster with the expand version, which is just noise) and that the time spent in notabs for a good sized package is 0.06 seconds f ...
|
Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com>
Thanks for the detailed reply John @urbanjost - that's good to hear. This looks good to me - I'll approve once the conflicts are resolved. |
Thanks @urbanjost - just noticing this PR looks very different all of a sudden, did you accidently merge in a different branch? I can see lot's of changes adding |
Simple PR to close #508