Feature #1927

Investigate performance of InterferenceFunction2DParaCrystal::interference1D method

Added by pospelov over 2 years ago.

Status:NewStart date:18 Dec 2017
Priority:LowDue date:
Assignee:-% Done:


Target version:-


Simulation using interference function of 2D para crystal is quite popular among users, however the performance is quite poor.

For the moment 90% of execution time of standard GUI example "Interference function of 2D para crystal" is spend inside
InterferenceFunction2DParaCrystal::interference1D method.

The most of the time where is inside

line 237: tmp = std::pow(fp, n);

Attempt #1:
Replacing tmp with tmp=0.0 makes simulation 5 times faster (but of course all para2D related functional tests fails with significant difference).

Attempt #2:
Replacement of std::pow(fp, n) with std::exp(n*std::log(fp)) only makes simulation 50% slower.

Also available in: Atom PDF