Skip to content
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

More validate optimisation #2321

Merged
merged 2 commits into from
Jun 13, 2017
Merged

Conversation

matthewrmshin
Copy link
Contributor

(Continue the theme from #2312.)

Avoid usage of costly regular expressions - use cheaper string replace instead.
Avoid doing the same string replacement multiple times.

Result of profile-battery on complex-validate.

Version            Run            Elapsed Time (s)  CPU Time - Total (s)  Max Memory (kb)
master             complex suite  9.7               9.8                   73156.0        
more-validate-opt  complex suite  8.6               8.6                   72928.0        

Avoid usage of costly regular expressions.
Avoid doing the same string replacement multiple times.
@matthewrmshin matthewrmshin added this to the next release milestone Jun 8, 2017
@matthewrmshin matthewrmshin self-assigned this Jun 8, 2017
@matthewrmshin
Copy link
Contributor Author

matthewrmshin commented Jun 8, 2017

Snippet from cylc validate --profile of the horrible suite mentioned in #2312.

On master:

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    13594    0.293    0.000   44.521    0.003 lib/cylc/graph_parser.py:368(_families_all_to_all)
   175840    3.340    0.000   43.345    0.000 lib/cylc/graph_parser.py:408(_add_trigger)

On this branch:

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    13594    0.120    0.000    1.997    0.000 lib/cylc/graph_parser.py:368(_families_all_to_all)
    13594    0.700    0.000    0.768    0.000 lib/cylc/graph_parser.py:395(_add_trigger)

@oliver-sanders oliver-sanders added the efficiency For notable efficiency improvements label Jun 8, 2017
Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

A mere 97% reduction - looks good to me!

Copy link
Member

@hjoliver hjoliver left a comment

Choose a reason for hiding this comment

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

Nice. (sanitized "horrible" suite validation now sub 1-min on my laptop, down from 9.5 min).

@hjoliver hjoliver merged commit 830c6f5 into cylc:master Jun 13, 2017
@matthewrmshin matthewrmshin deleted the more-validate-opt branch June 14, 2017 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
efficiency For notable efficiency improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants