You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was running the benchmarker for this regex #"<(\w*)\b[^>]*>(.*?)<\/\1>"# which uses \b to match the end of a html tag and noticed it was running really slow
Some amount of regression was expected with the implementation of the new word breaking algorithm but a 300x slowdown seems unacceptable. A quick profile shows that ~99% of the time is spent in AssertFunction, with 90% of that being String._wordIndex(after:) and 10% being Set.insert
yeah the current implementation of String.isOnWordBoundary in this repo is really inefficient and was fully expecting perf to be pretty bad. Once _nearestWordIndex(atOrBelow:) is fixed, I think this operation will get considerably faster.
I was running the benchmarker for this regex
#"<(\w*)\b[^>]*>(.*?)<\/\1>"#
which uses\b
to match the end of a html tag and noticed it was running really slowed842cb
main
Some amount of regression was expected with the implementation of the new word breaking algorithm but a 300x slowdown seems unacceptable. A quick profile shows that ~99% of the time is spent in
AssertFunction
, with 90% of that beingString._wordIndex(after:)
and 10% beingSet.insert
cc @Azoy @milseman
The text was updated successfully, but these errors were encountered: