Shortcode icon indicating copy to clipboard operation
Shortcode copied to clipboard

Drop offsets when tokenizing with RegularParser

Open funkjedi opened this issue 1 year ago • 0 comments

Testing using my sample string that was causing memory issues for me memory usage was reduced by 46% using refactor.

Super simple test, showing peak usage after processing (aka. memory_get_peak_usage()) minus peak prior to processing.

new code existing code
110MB 258MB

Also referenced in https://github.com/thunderer/Shortcode/issues/110


Note on changes. Reversed order of cases in switch as when for example marker is matched any subsequent captures (ex, separator) won't be present in matches array.

funkjedi avatar Apr 23 '24 04:04 funkjedi