Menu

Commit [r8741]  Maximize  Restore  History

Massive speed up of the bond_vectors() method.

The algorithm used was very, very poorly designed. Now when setting the profile flag to 1 gives the
following. Before in one test:

11168736 function calls (10986641 primitive calls) in 76.750 CPU seconds

ncalls tottime percall cumtime percall filename:lineno(function)
758954 12.160 0.000 51.060 0.000 /home/edau/relax/relax-1.3/generic_fns/relax_re.py:31(search)
141 0.890 0.006 67.620 0.480 /home/edau/relax/relax-1.3/generic_fns/structure/internal.py:444(bond_vectors)

All other function call info lines have been removed. After the changes:

2586419 function calls (2579305 primitive calls) in 21.370 CPU seconds

ncalls tottime percall cumtime percall filename:lineno(function)
62803 1.180 0.000 5.020 0.000 /home/edau/relax/relax-1.3/generic_fns/relax_re.py:31(search)
141 0.060 0.000 12.020 0.085 /home/edau/relax/relax-1.3/generic_fns/structure/internal.py:444(bond_vectors)

The difference is that the selection object is no longer used, as it is completely unnecessary.

bugman 2009-02-05

changed /1.3/generic_fns/structure/internal.py
changed /1.3/generic_fns/structure/main.py
/1.3/generic_fns/structure/internal.py Diff Switch to side-by-side view
Loading...
/1.3/generic_fns/structure/main.py Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.