Shortcode
Shortcode copied to clipboard
Drop offsets when tokenizing with RegularParser
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.