Skip to content
Snippets Groups Projects
Commit 597f03b4 authored by Colin Walters's avatar Colin Walters
Browse files

dirfd: Use better and faster random algorithm for gen_temp_name()

I was looking at ostree performance, and a surprising amount of
time was spent in `glnx_gen_temp_name()`.  We end up calling it
from the main loop, and the iteration here shows up in my perf
profiles.

The glibc algorithm here that we adopted is *very* dated; let's
switch to use `GRand`, which gives us a better algorithm.

It'd be even better of course to use `getrandom()`, but we should do that in
glib at some point.

While I had the patient open, I extended the charset with lowercase, to better
avoid collisions.
parent abd37a47
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment