HomePhorge

perf: reduce copying when sorting

Description

perf: reduce copying when sorting

Passes values by reference when sorting to reduce memory copying. The
main saving on this is preventing copying of the large vector of files
getting passed into the sort function and then copying each item in
the vector in the for. This results in about a 27% performance gain
reducing the full benchmark of the kubernetes benchmark by 7.89 sec

Before

NameTotalAverageMinMax
ivy_match(file.lua) 1000000x02.351614 (s)00.000002 (s)00.000002 (s)00.000042 (s)
ivy_files(kubernetes) 100x32.704256 (s)00.327043 (s)00.289397 (s)00.344413 (s)

After

NameTotalAverageMinMax
ivy_match(file.lua) 1000000x02.353386 (s)00.000002 (s)00.000002 (s)00.000049 (s)
ivy_files(kubernetes) 100x24.809576 (s)00.248096 (s)00.203167 (s)00.270263 (s)

Details

Provenance
AdeAttwoodAuthored on Aug 7 2022, 3:48 PM
Parents
R1:1ae47813d718: feat: add benchmarks
Branches
Unknown
Tags
Unknown

Event Timeline