Skip to content
  • Daniel Silverstone's avatar
    _stream.py, _project.py: Manage GC during pipeline load · 746aa7a6
    Daniel Silverstone authored
    
    
    Since during pipeline load we are generating a lot of objects
    which need to live for the duration of the BuildStream instance
    there is benefit to disabling GC for the duration of the load since
    that drastically reduces wasted CPU cycles iterating data which
    will remain around always.  In order to limit the increase in
    the peak memory consumption though, we do an explicit gc.collect()
    after loading the YAML in, since without that, we use 60% more
    memory at peak, and with it, only 20%.
    
    Signed-off-by: default avatarDaniel Silverstone <daniel.silverstone@codethink.co.UK.>
    746aa7a6