Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295310

Speed up Drupal with splat (variadics)

$
0
0

PHP 5.6 includes support for variadic functions and a new operator, the delightfully named "splat" (...). In essence it's a nicer replacement for call_user_func_array() and func_get_args(). See

http://php.net/manual/en/functions.arguments.php#functions.variable-arg-...

Variadics and splat are marginally faster than call_user_func_array(), at least based on the microbenchmarks that were done when they were added to the language. Normally it wouldn't make enough of a difference to care, but Drupal uses call_user_func_array() *a lot*. Like, everywhere. So this is an experiment to see if maintaining a variadic fork of Drupal 8 would be useful.

The attached patch will fail miserably on PHP 5.5 of course, but let's see if it works on 5.6. It should. :-) Assuming it does, I'd like someone's help in benchmarking it to see if it's worthwhile to maintain.


Viewing all articles
Browse latest Browse all 295310

Trending Articles



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