Hi,
Profiling potentially shows that things are being copied. If the process runs
long enough then garbage collection will kick in.
I know it’s superficial for this process in the big picture and that collecting
package signatures is the culprit that needs a speed up.
245 2.10ms 245 7.44ms my ($stem, $version) =
OpenBSD::PackageName::splitname($_);
# spent 7.44ms making 245 calls to
OpenBSD::PackageName::splitname, avg 30µs/call
245 617µs $port->{$subdir}{stem} =
$stem;
245 456ms 245 454ms $port->{$subdir}{version} =
$version;
# spent 454ms making 245 calls to main::CORE:readline, avg
1.85ms/call
-------------
($port->{$subdir}{stem}, $port->{$subdir}{version})
245 449ms 490 452ms =
OpenBSD::PackageName::splitname($_);
# spent 445ms making 245 calls to
main::CORE:readline, avg 1.82ms/call
# spent 6.98ms making 245 calls to
OpenBSD::PackageName::splitname, avg 28µs/call
Ian McWilliam
> On 13 Oct 2024, at 11:21 pm, Marc Espie <[email protected]> wrote:
>
> On Sat, Oct 12, 2024 at 11:28:40AM +1100, Ian McWilliam wrote:
>> Hi,
>>
>> In the universe’s grand scheme of things the wasted memory, garbage
>> collection and cpu cycles doesn’t mean much.
>>
>> The patch removes variable allocation in a while loop that is not needed.
>>
>> Ian McWilliam
>>
>
> Have you checked that it actually saves memory ? Strings are very much
> shared in that context.