Profiling project

Issue #109 new
Juan Pablo Caram repo owner created an issue

As algorithms get more and more complicated and more data is being parsed and displayed there is considerable impact on performance. Profiling should be done to identify bottlenecks.

Comments (2)

  1. Juan Pablo Caram reporter

    When profiling Gerber.parse_file():

    • log.setLevel(logging.DEBUG): 1.3 seconds.
    • log.setLevel(logging.WARNING): 0.8 seconds.
  2. Juan Pablo Caram reporter

    Results from parsing a very large file:

    Mon Feb  2 16:17:36 2015    gerber1_profile
    
             97848 function calls (97828 primitive calls) in 24.521 seconds
    
       Ordered by: cumulative time
       List reduced from 117 to 12 due to restriction <0.1>
    
       ncalls  tottime  percall  cumtime  percall filename:lineno(function)
            1    0.000    0.000   24.521   24.521 <string>:1(<module>)
            1    0.003    0.003   24.521   24.521 camlib.py:1414(parse_file)
            1    0.250    0.250   24.499   24.499 camlib.py:1432(parse_lines)
            1   23.554   23.554   23.557   23.557 ops.py:116(cascaded_union)
          758    0.017    0.000    0.203    0.000 base.py:454(buffer)
          738    0.006    0.000    0.159    0.000 linestring.py:30(__init__)
          738    0.015    0.000    0.153    0.000 linestring.py:89(_set_coords)
          758    0.117    0.000    0.128    0.000 topology.py:76(__call__)
          738    0.058    0.000    0.115    0.000 linestring.py:182(geos_linestring_from_py)
        23985    0.082    0.000    0.082    0.000 {method 'group' of '_sre.SRE_Match' objects}
        16298    0.079    0.000    0.079    0.000 {method 'search' of '_sre.SRE_Pattern' objects}
          760    0.029    0.000    0.056    0.000 base.py:52(geom_factory)
    
    
    
    Process finished with exit code 0
    

    cascaded_union() takes 96% of the total work! It was applied to 835 polygons.

  3. Log in to comment