Last modified: 2013-04-22 16:15:37 UTC
Created attachment 11009 [details] profiler image This check for 'is a generator' is quite expensive for ApiQuery - as it has to load all class files to resolve it: private function makeGeneratorList( $moduleList ) { foreach( $moduleList as $moduleName => $moduleClass ) { if ( is_subclass_of( $moduleClass, 'ApiQueryGeneratorBase' ) ) { It may make sense to build generator list in somewhat lighter way. This is ends up being 30%+ of API setup cost for simple API queries, e.g. api.php?action=query&format=txt Attaching profiler image.
Yay, reflection. Done like this, it's always going to be costly This is at least somewhat better than it was (changed recently), in some cases, where this list would be created twice... We stick this in some apc (maybe the simplest way), or memcached, though that feels slightly strange Other than that, I suppose we could have this defined in code, rather than the current resultant iteration over $wgAPIPropModules and $wgAPIListModules
(In reply to comment #1) > We stick this in some apc (maybe the simplest way), or memcached, though that > feels slightly strange Though, it would need to vary on dbname, due to various different extensions being enabled on different wikis... Also, removing the reflection inference is a bit of a "breaking change", requiring extension authors to update their extensions where necessary.,
introducing reflection inference is already a breaking change :-)
(In reply to comment #3) > introducing reflection inference is already a breaking change :-) It's not new, just has been refactored...
https://gerrit.wikimedia.org/r/22837