Last modified: 2011-03-13 18:06:48 UTC
Copypaste from email:
> There is a mention in the comment that this could be probably done better.
> You're right. I rewrote the function and it's now like 10x faster, because
> regular expressions are slow and now it uses an indexed array. Which is
> lightning fast.
Created attachment 137 [details]
The new proposed wfgettype() function
I should note that the performance gain is actually very slight; my
benchmarks show only about a 2% speed improvement in load time
of img_auth.php as a whole (with Turck MMCache enabled to reduce
the PHP compilation overhead). That's moving from 30 milliseconds
per hit to 29 milliseconds.