Skip to content

The test suite spends 20% of it's time in gc.collect() #6705

Closed
@Kojoley

Description

@Kojoley
Thu Jul 07 14:33:31 2016    matplotlib_cProfile_fulltest.pstat

         192634679 function calls (182051956 primitive calls) in 345.231 seconds

   Ordered by: internal time
   List reduced from 9374 to 3 due to restriction <3>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     2986   75.105    0.025   75.107    0.025 {gc.collect}
     1250   19.139    0.015   19.139    0.015 {matplotlib._png.write_png}
     2257    9.801    0.004    9.801    0.004 {matplotlib._png.read_png_int}

Mostly this is due to this call

Python is very memory effective because of reference counting (object is freed when refcount drops to zero even with gc.disable) and gc.collect only forces him to run cyclic garbage collector immediately. If it is not acceptable to to remove this call, can we have option to tuning this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions