cameronterry / dark-matter

A highly opinionated domain mapping plugin for WordPress Networks
Other
12 stars 2 forks source link

Small URL mapping and redirect performance enhancements #67

Closed cameronterry closed 3 years ago

cameronterry commented 3 years ago

This PR strategically replaces the use of in_array() in favour of array_key_exists() to improve performance, as noted by this benchmark run here: https://3v4l.org/K046Q/perf#output. This benchmark also illustrates that this improvement holds for PHP 8.0 as well as the various PHP 7.x releases.

Changes are primarily focused on areas where in_array() is used often, such as URL mapping and redirection, with a specific focus on improving load times and performance of the public-facing side running the primary domain.

Release notes: