Skip to content

ENH: Mapping: Small performance fix#552

Merged
richardotis merged 1 commit intopycalphad:developfrom
richardotis:mapping-2d-func-perf
Jul 27, 2024
Merged

ENH: Mapping: Small performance fix#552
richardotis merged 1 commit intopycalphad:developfrom
richardotis:mapping-2d-func-perf

Conversation

@richardotis
Copy link
Collaborator

@richardotis richardotis commented Jul 26, 2024

This PR moves FastFunctionFactory.getfunc() out of a tight loop inside of PhaseRecord.prop_2d(). Despite hitting the cache, it seems that getfunc() takes appreciable time and, for large numbers of inputs (num_imps), it can become as much as 40% of the runtime of that function. For large values of pdens (such as the value 500, used by default inside of mapping), this significantly impacts the calculate function.

On my laptop, this change shaves a few seconds off the mapping tests.

@richardotis richardotis changed the title ENH: PhaseRecord: Factor FastFunctionFactory.getfunc() out of a tight… ENH: Mapping: Small performance fix Jul 26, 2024
@codecov
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.75%. Comparing base (c24d881) to head (8c198a4).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #552   +/-   ##
========================================
  Coverage    91.74%   91.75%           
========================================
  Files           77       77           
  Lines        11981    11982    +1     
========================================
+ Hits         10992    10994    +2     
+ Misses         989      988    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bocklund bocklund self-requested a review July 27, 2024 17:26
@richardotis richardotis merged commit 01c2e63 into pycalphad:develop Jul 27, 2024
@richardotis richardotis deleted the mapping-2d-func-perf branch July 27, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants