[Chapel Merge] Regex allocation and comm reduction

Branch: refs/heads/main
Revision: c3bd459
Author: aconsroe-hpe
Link: Unavailable
Log Message:

Merge pull request #18733 from aconsroe-hpe/regex-allocations-3-pretty

Regex allocation and comm reduction

reviewed and contributions by @ronawho and @mppf (thank you!)

While we landed better support for multilocale regex by implementing chpl__serialize in #18678, we weren't actually packing the pattern string/bytes inline. This PR fixes that and results in reduced comm counts when the pattern is small enough to fit inside the string/bytes own inline buffer.

We can now also turn many of the heap allocations into stack allocations because the execution of the matching will now always happen on here.

Tests cover comm counts for serialization, allocation counts for local search and matches (where we expect to see our reduced allocations), and a general test of the new behavior for local+remote regexes.

  • [x] Full paratest pass

    Modified Files:
    A test/regex/allocationCounts.chpl
    A test/regex/allocationCounts.good
    A test/regex/allocationCounts.prediff
    A test/regex/localFastPath.chpl
    A test/regex/localFastPath.compopts
    A test/regex/localFastPath.good
    A test/regex/localFastPath.numlocales
    A test/regex/serializationCommCounts.chpl
    A test/regex/serializationCommCounts.compopts
    A test/regex/serializationCommCounts.good
    A test/regex/serializationCommCounts.numlocales
    M modules/standard/Regex.chpl

    Compare: Comparing 133ec720993c...c3bd459f4b54 · chapel-lang/chapel · GitHub