[openstreetmap/openstreetmap-website] Scope wiki linkification characters using POSIX words (PR #6612)
Pablo Brasero
notifications at github.com
Fri Dec 19 17:12:01 UTC 2025
pablobm left a comment (openstreetmap/openstreetmap-website#6612)
Not sure it's enough for a timeout, but I can confirm that in the `key=value` patterns, the `\p{Word}` ones are running about 10x slower than similar `\w` ones (just as a comparison, I know they are not the same). These are some numbers, taken from running `test/models/diary_entry_test.rb` in my computer:
```
11us - /(?<=^|[^\w!#$%&'*+,.\/:;=?@_~^\-])(?<key>[-+,.:;'%()\w]+)=(?<value>[-+,.:;'%()\/\w]+)/i
116us, /(?<=^|[^\w!#$%&'*+,.\/:;=?@_~^\-])(?<key>[-+,.:;'%()\p{Word}]+)=(?<value>[-+,.:;'%()\/\p{Word}]+)/i
11us /(?<=^|[^\w!#$%&'*+,.\/:;=?@_~^\-])(?<key>[-+,.:;'%()\w]+)=(?<value>[-+,.:;'%()\/\w]+)/i
116us, /(?<=^|[^\w!#$%&'*+,.\/:;=?@_~^\-])(?<key>[-+,.:;'%()\p{Word}]+)=(?<value>[-+,.:;'%()\/\p{Word}]+)/i
24us /(?<=^|[^\w!#$%&'*+,.\/:;=?@_~^\-])(?<key>[-+,.:;'%()\w]+)=(?<value>[-+,.:;'%()\/\w]+)/i
236us /(?<=^|[^\w!#$%&'*+,.\/:;=?@_~^\-])(?<key>[-+,.:;'%()\p{Word}]+)=(?<value>[-+,.:;'%()\/\p{Word}]+)/i
32us /(?<=^|[^\w!#$%&'*+,.\/:;=?@_~^\-])(?<key>[-+,.:;'%()\w]+)=(?<value>[-+,.:;'%()\/\w]+)/i
302us /(?<=^|[^\w!#$%&'*+,.\/:;=?@_~^\-])(?<key>[-+,.:;'%()\p{Word}]+)=(?<value>[-+,.:;'%()\/\p{Word}]+)/i
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6612#issuecomment-3675875126
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6612/c3675875126 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251219/45aebecd/attachment.htm>
More information about the rails-dev
mailing list