Difference between revisions of "GEPS 016: Enhancing Gramps Processing Speed"

From Gramps
Jump to: navigation, search
(Profiling)
(Importing)
Line 14: Line 14:
  
 
See a discussion on [http://www.nabble.com/Glacial-imports-ts25873548.html Glacial imports].
 
See a discussion on [http://www.nabble.com/Glacial-imports-ts25873548.html Glacial imports].
 +
 +
A profile log of importing a gramps file: [[Media:profile-import.log]]
  
 
== Profiling ==
 
== Profiling ==

Revision as of 13:10, 17 October 2009

This is a GEP for examining, detailing, and proposing enhancements to address speed issues in GRAMPS.

Enhancing Speed Workflow

The first step in working toward speeding up GRAMPS is to identify particular functions or activities that take more time than you would like.

The next is to examine in detail what functions are the bottle-necks in the processing. This is most easily and scientifically done through Python's Profiling tools.

Finally, developers can rewrite functions to speed up processing.

Areas of Speed Enhancement

Importing

See a discussion on Glacial imports.

A profile log of importing a gramps file: Media:profile-import.log

Profiling

Here is an example of starting up a command-line function and profiling it:

python /usr/lib/python2.6/cProfile.py -o profile-log src/gramps.py -i ~/Desktop/import-test.gramps

This example will save the profile output into a file called profile-log which can then be analyzed using the Stats class (described below).

This can take quite a bit of time. Note: importing does not automatically exit gramps. You should immediately exit, so that the code of running the GUI does not effect the profile of the import.

Profile Analysis

To analyze a profile log you can:

>>> import pstats
>>> profile_stats = pstats.Stats('profile-log')
>>> profile_stats.sort_stats('cumulative').print_stats(10)

Profile Links

Patches and Fixes