Skip to content
Snippets Groups Projects
Verified Commit 82867bbd authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

lib/generic/array: avoid quadratic work for long arrays

For long arrays we really want to increase their length by a fraction.
Otherwise it will cost lots of CPU.  Doubling seems customary,
though I could imagine e.g. keeping the +50% growth on longest arrays.

I finally got sufficiently angry with this piece of code when debugging
https://forum.turris.cz/t/how-to-debug-a-custom-hosts-file-for-kresd/17449
though in that case it wasn't the main source of inefficiency.

CI: two of the mysterious/bogus warnings around arrays disappeared.
parent e2db62c0
Branches
Tags
1 merge request!1336lib/generic/array: avoid quadratic work for long arrays
Pipeline #102905 failed with stages
in 30 minutes and 11 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment