Quantcast
Viewing all articles
Browse latest Browse all 295752

_filter_url() is slow because preg_match() is slow, use strcasecmp() when possible

I have a page where _filter_url() is 30% of the load time. The content has lots of markup and the $chunks array in _filter_url() ends up with over 5000 items. A simple change from preg_match() to strcasecmp() reduces my page load time for _filter_url() to only 20% of the page time, from 190msec to 120msec.

AttachmentSizeStatusTest resultOperations
filter-url-1.patch544 bytesIgnored: Check issue status.NoneNone

Viewing all articles
Browse latest Browse all 295752


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>