Normalize and cache the paths returned by CVSFile.get_filename().
commit43161af61866412775d44f3d5a0df55cdce7cdd5
authormhagger <mhagger@be7e6eca-30d4-0310-a8e5-ac0d63af7087>
Thu, 8 Apr 2010 19:20:47 +0000 (8 19:20 +0000)
committermhagger <mhagger@be7e6eca-30d4-0310-a8e5-ac0d63af7087>
Thu, 8 Apr 2010 19:20:47 +0000 (8 19:20 +0000)
tree49510a5bb860541705d7682751e538fe32ebb725
parente9eff8a0767235da1a1a29dfb17bcb413636ea77
Normalize and cache the paths returned by CVSFile.get_filename().

Patch by: Jon Foster <jon.foster@cabot.co.uk>

Selected parts of my profiling results:

ncalls cumtime function
     1    4183 main.py:run_with_profiling
     1    2997 collect_data.py:process_project
    2M    1957 collect_data.py:transform_symbol
   42M    1845 SubtreeSymbolTransform.__does_rule_apply_to
  234M     736 os.path.dirname
   42M     476 CVSFile.get_filename
   42M     285 os.path.normpath
   95M*    266 CVSDirectory.get_filename

(*including recursive calls, which were about 50% of the total).

So CVSFile.get_filename() is responsible for about 10% of cvs2svn's
overall runtime.  This patch reduces that to almost zero, by
calculating the filename when the CVSFile is created, and storing it
directly in a CVSFile.filename member variable.

git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5108 be7e6eca-30d4-0310-a8e5-ac0d63af7087
cvs2svn_lib/cvs_path.py