Actions
Feature #17219
closedMake URI#hostname 86-89% and hostname= 55-154% faster
Status:
Closed
Assignee:
-
Target version:
-
Description
Hello,
URI#hostname extends URI#host with IPv6 support. In URI, IPv6 address must have square brackets (e.g. http://[2001:db8::1]
), URI#hostname strips these characters out while URI#hostname= adds them if missing. There are three regular expressions to perform these tasks which can dramatically slow down performance. I am attaching a two-line patch and here is a benchmark: https://gist.github.com/lzap/24cbecb47daf29111350e41a24250922
Results are in the gist. A patch and a PR incoming.
Files
Actions
Like0
Like0Like0Like0Like0