copying global stuff to one file
- Posted by Tone Škoda <tskoda at email.si> Nov 08, 2004
- 476 views
i would like a tool which copies needed global stuff from included files to file which includes them, and make that copied stuff non-global. i want this to avoid global names collisions. is there some tool like this already, or some way that it can be done easy? what i basically need is a program which will find out which global stuff from included files a file uses. is there some way this can easily be done? i want to release a cool library i made which profiles code. here's an example output:
=========================================================================== =========================================================================== Profiling on 8. November 2004 1:11:54 --------------------------------------------------------------------------- 1 Update 'All_work_objects' Total run time : 0.020000 seconds Average run time : 0.000034 seconds Times run : 581 --------------------------------------------------------------------------- --------------------------------------------------------------------------- 1 Update 'Potent_workobjs' Total run time : 199.250000 seconds Average run time : 0.342943 seconds Times run : 581 --------------------------------------------------------------------------- --------------------------------------------------------------------------- 2 Get indexes Total run time : 0.550000 seconds Average run time : 0.000947 seconds Times run : 581 % of parent : 0% % of root parent : 0% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 2 Remove old Total run time : 0.770000 seconds Average run time : 0.001325 seconds Times run : 581 % of parent : 0% % of root parent : 0% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 2 Add new Total run time : 197.930000 seconds Average run time : 0.340671 seconds Times run : 581 % of parent : 99% % of root parent : 99% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 3 Get 'relink_wobjs_ids' Total run time : 0.000000 seconds Average run time : 0.000000 seconds Times run : 581 % of parent : 0% % of root parent : 0% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 3 Get 'new_potwobjs' Total run time : 197.170000 seconds Average run time : 0.339363 seconds Times run : 581 % of parent : 99% % of root parent : 98% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 4 get_potwobj_for_wobj(): WHOLE Total run time : 196.920000 seconds Average run time : 0.012053 seconds Times run : 16338 % of parent : 99% % of root parent : 98% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 5 startup Total run time : 2.090000 seconds Average run time : 0.000128 seconds Times run : 16338 % of parent : 1% % of root parent : 1% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 5 loop Total run time : 112.730000 seconds Average run time : 0.006900 seconds Times run : 16338 % of parent : 57% % of root parent : 56% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 6 join_two_wobjs() call Total run time : 4.040000 seconds Average run time : 0.000044 seconds Times run : 91892 % of parent : 3% % of root parent : 2% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 7 join_two_wobjs():WHOLE Total run time : 3.250000 seconds Average run time : 0.000035 seconds Times run : 91892 % of parent : 80% % of root parent : 1% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 6 get_work_object_distinctiveness() Total run time : 107.720000 seconds Average run time : 0.001172 seconds Times run : 91892 % of parent : 95% % of root parent : 54% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 5 getting borders Total run time : 81.460000 seconds Average run time : 0.004986 seconds Times run : 16338 % of parent : 41% % of root parent : 40% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 6 get_one_edge () call Total run time : 46.850000 seconds Average run time : 0.002823 seconds Times run : 16597 % of parent : 57% % of root parent : 23% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 7 get_one_edge(): WHOLE Total run time : 46.670000 seconds Average run time : 0.002812 seconds Times run : 16597 % of parent : 99% % of root parent : 23% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 8 Direct 'start_pixedge' Total run time : 0.550000 seconds Average run time : 0.000033 seconds Times run : 16597 % of parent : 1% % of root parent : 0% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 8 main loop outside Total run time : 45.780000 seconds Average run time : 0.002758 seconds Times run : 16597 % of parent : 98% % of root parent : 22% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 8 end Total run time : 0.120000 seconds Average run time : 0.000007 seconds Times run : 16597 % of parent : 0% % of root parent : 0% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 5 finish Total run time : 0.240000 seconds Average run time : 0.000015 seconds Times run : 16338 % of parent : 0% % of root parent : 0% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 3 Add Total run time : 0.740000 seconds Average run time : 0.001274 seconds Times run : 581 % of parent : 0% % of root parent : 0% --------------------------------------------------------------------------- --------------------------------------------------------------------------- 1 Update 'Final_objects' Total run time : 1.930000 seconds Average run time : 0.003322 seconds Times run : 581 --------------------------------------------------------------------------- =========================================================================== ===========================================================================