[wp-hackers] Micro optimization - is_a() vs instanceof

Dobri dyordan1 at ramapo.edu
Fri Jan 4 15:32:02 UTC 2013


What's your source? Did you read this somewhere? If so, do you have a link, it'd be an interesting read… In either case though, my guts say execution time of both is almost negligible, so twice as negligible isn't really doing much, given how much effort it would take to replace it throughout the code (even with regexp or whatnot, which would be quick but prone to introducing bugs). Still, if you have an article that says otherwise, please do link to it. Cheers!

On Fri, 4 Jan 2013, at 4:28 AM, Marko Heijnen wrote:

> I was looking in the difference and performance aspect of is_a() and instance of. Believing this test it should be 2-3 times faster depending on the PHP version you have. Even tho it's micro optimization I'm curious if WordPress should change to this.
> 
> There are already two tickets closed as "won't fix" but the first one did mentioned that we can look into it when moving to PHP5.
> 
> - http://core.trac.wordpress.org/ticket/10264
> - http://core.trac.wordpress.org/ticket/19381
> 
> Marko
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

~Dobri



More information about the wp-hackers mailing list