[pygccxml-commit] SF.net SVN: pygccxml: [1006] pygccxml_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2007-04-19 16:26:56
|
Revision: 1006 http://svn.sourceforge.net/pygccxml/?rev=1006&view=rev Author: roman_yakovenko Date: 2007-04-19 09:26:58 -0700 (Thu, 19 Apr 2007) Log Message: ----------- testing performance on pretty big xml file ( 31Mb ) Modified Paths: -------------- pygccxml_dev/unittests/test_performance.py Added Paths: ----------- pygccxml_dev/unittests/data/big.xml.bz2 Added: pygccxml_dev/unittests/data/big.xml.bz2 =================================================================== (Binary files differ) Property changes on: pygccxml_dev/unittests/data/big.xml.bz2 ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: pygccxml_dev/unittests/test_performance.py =================================================================== --- pygccxml_dev/unittests/test_performance.py 2007-04-19 16:15:51 UTC (rev 1005) +++ pygccxml_dev/unittests/test_performance.py 2007-04-19 16:26:58 UTC (rev 1006) @@ -6,19 +6,22 @@ import os import sys import time +import pstats +import cProfile import autoconfig - from pygccxml import * + + dcache_file_name = os.path.join( autoconfig.data_directory, 'pygccxml.cache' ) if os.path.exists(dcache_file_name): os.remove(dcache_file_name) def test_on_windows_dot_h(): - windows_header = r"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\windows.h" + windows_header = r"D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\windows.h" clock_prev = time.clock() dcache = parser.file_cache_t(dcache_file_name) - reader = parser.source_reader_t( parser.config_t(), dcache ) + reader = parser.source_reader_t( parser.config_t(gccxml_path=autoconfig.gccxml_path), dcache ) reader.read_file(windows_header) dcache.flush() clock_now = time.clock() @@ -26,7 +29,7 @@ clock_prev = time.clock() dcache = parser.file_cache_t(dcache_file_name) - reader = parser.source_reader_t( parser.config_t(), dcache ) + reader = parser.source_reader_t( parser.config_t(gccxml_path=autoconfig.gccxml_path), dcache ) reader.read_file(windows_header) clock_now = time.clock() print 'with cache : %f seconds' % ( clock_now - clock_prev ) @@ -37,7 +40,7 @@ include_std_header = os.path.join( autoconfig.data_directory, 'include_std.hpp' ) clock_prev = time.clock() dcache = parser.file_cache_t(dcache_file_name) - reader = parser.source_reader_t( parser.config_t(), dcache ) + reader = parser.source_reader_t( parser.config_t(gccxml_path=autoconfig.gccxml_path), dcache ) reader.read_file(include_std_header) dcache.flush() clock_now = time.clock() @@ -45,7 +48,7 @@ clock_prev = time.clock() dcache = parser.file_cache_t(dcache_file_name) - reader = parser.source_reader_t( parser.config_t(), dcache ) + reader = parser.source_reader_t( parser.config_t(gccxml_path=autoconfig.gccxml_path), dcache ) reader.read_file(include_std_header) clock_now = time.clock() print 'with cache : %f seconds' % ( clock_now - clock_prev ) @@ -57,7 +60,7 @@ include_std_header = os.path.join( autoconfig.data_directory, 'include_std.hpp' ) clock_prev = time.clock() dcache = parser.file_cache_t(dcache_file_name) - reader = parser.project_reader_t( parser.config_t(), dcache ) + reader = parser.project_reader_t( parser.config_t(gccxml_path=autoconfig.gccxml_path), dcache ) reader.read_files([include_std_header]) dcache.flush() clock_now = time.clock() @@ -65,29 +68,42 @@ clock_prev = time.clock() dcache = parser.file_cache_t(dcache_file_name) - reader = parser.project_reader_t( parser.config_t(), dcache ) + reader = parser.project_reader_t( parser.config_t(gccxml_path=autoconfig.gccxml_path), dcache ) reader.read_files([include_std_header]) clock_now = time.clock() print 'with cache : %f seconds' % ( clock_now - clock_prev ) def profile_project(): include_std_header = os.path.join( autoconfig.data_directory, 'include_std.hpp' ) - reader = parser.project_reader_t( parser.config_t() ) + reader = parser.project_reader_t( parser.config_t(gccxml_path=autoconfig.gccxml_path) ) reader.read_files([include_std_header]) def profile_project2(): - include_std_header = r"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\windows.h" - reader = parser.project_reader_t( parser.config_t() ) + include_std_header = r"D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\windows.h" + reader = parser.project_reader_t( parser.config_t(gccxml_path=autoconfig.gccxml_path) ) reader.read_files([include_std_header]) +def parse_big_file(): + reader = parser.project_reader_t( parser.config_t(gccxml_path=autoconfig.gccxml_path) ) + + reader.read_files([parser.create_gccxml_fc( os.path.join( autoconfig.data_directory, 'big.xml' ) )]) + + if __name__ == "__main__": - test_on_windows_dot_h() - test_source_on_include_std_dot_hpp() - test_project_on_include_std_dot_hpp() - #~ import profile - #~ profile.run('profile_project()', 'pygccxml.profile') - #~ import pstats - #~ pdata = pstats.Stats('pygccxml.profile') - #~ pdata.strip_dirs() - #~ pdata.sort_stats('cumulative', 'time').print_stats(15) - #~ pdata.print_callers('find_all_declarations') \ No newline at end of file + + #~ test_on_windows_dot_h() + #~ test_source_on_include_std_dot_hpp() + #~ test_project_on_include_std_dot_hpp() + print 'running' + cProfile.run('parse_big_file()', 'pygccxml.profile') + print 'running - done' + print 'loading file' + pdata = pstats.Stats('pygccxml.profile') + print 'loading file - done' + print 'striping dirs' + pdata.strip_dirs() + print 'striping dirs - done' + print 'sorting stats' + pdata.sort_stats('cumulative', 'time').print_stats(476) + print 'sorting stats - done' + #pdata.print_callers('find_all_declarations') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |