https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128722
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
CC| |jvdelisle at gcc dot gnu.org
Last reconfirmed| |2026-11-16
Status|UNCONFIRMED |NEW
--- Comment #2 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Confirmed. I ran a benchmark here: a 5M-element pointer array through a dummy,
sync and async, built with trunk and with the patched compiler, plus a
non-pointer control that both pass by descriptor.
┌──────────────────────────────────────┬─────────┬─────────┬─────────┐
│ Case │ Trunk │ Patched │ Speedup │
├──────────────────────────────────────┼─────────┼─────────┼─────────┤
│ Pointer to d%x (32-byte span), sync │ 0.073 s │ 0.053 s │ 1.4× │
├──────────────────────────────────────┼─────────┼─────────┼─────────┤
│ Pointer to d%x (32-byte span), async │ 1.269 s │ 0.053 s │ 24× │
├──────────────────────────────────────┼─────────┼─────────┼─────────┤
│ Contiguous pointer, sync │ 0.073 s │ 0.008 s │ 9× │
├──────────────────────────────────────┼─────────┼─────────┼─────────┤
│ Contiguous pointer, async │ 1.268 s │ 0.008 s │ 160× │
├──────────────────────────────────────┼─────────┼─────────┼─────────┤
│ Control (non-pointer dummy) │ 0.008 s │ 0.008 s │ — │
└──────────────────────────────────────┴─────────┴─────────┴─────────┘
- Async is where the big gain is. Trunk queues one item per element: a calloc
plus a lock and signal, 5 million times.
- Sync with a non-contiguous span improves only 1.4×. The library still copies
a strided array element by element; it just no longer goes through a library
call per element.