{"push_id":1806961159,"size":1,"distinct_size":1,"ref":"refs/heads/memory-hungry-not","head":"d5c2d6f23ea25cd84cb5233f437eb4b7faef16e1","before":"f67ae27489f0d252750bd131fb3a4fc47158efee","commits":[{"sha":"d5c2d6f23ea25cd84cb5233f437eb4b7faef16e1","author":{"name":"Antonio Murdaca","email":"d300d9d102629097aeb4a9769819a73ce4b404d4@redhat.com"},"message":"layers|containers: do not allocate slices at every delete\n\nWhen Delete:ing a layer or a container the code was always allocating a\nnew slice just to remove an element from the original slice.\nProfiling cri-o with c/storage showed that doing it at every delete is\npretty expensive:\n\n```\n         .          .    309:   newContainers := []Container{}\n         .          .    310:   for _, candidate := range r.containers\n{\n         .          .    311:           if candidate.ID != id {\n  528.17kB   528.17kB    312:                   newContainers =\nappend(newContainers, candidate)\n         .          .    313:           }\n         .          .    314:   }\n\n         .          .    552:           newLayers := []Layer{}\n         .          .    553:           for _, candidate := range\nr.layers {\n         .          .    554:                   if candidate.ID != id {\n    1.03MB     1.03MB    555:                           newLayers =\nappend(newLayers, candidate)\n         .          .    556:                   }\n         .          .    557:           }\n         .          .    558:           r.layers = newLayers\n```\n\nThis patch just filters out the element to remove from the original\nslice w/o allocating a new slice. After this patch, no memory overhead\nanymore is shown in the profiler.\n\nSigned-off-by: Antonio Murdaca <runcom@redhat.com>","distinct":true,"url":"https://api.github.com/repos/runcom/storage/commits/d5c2d6f23ea25cd84cb5233f437eb4b7faef16e1"}]}
{"actor":{"display_login":"runcom"}}