[00:19:59] TimStarling: https://phabricator.wikimedia.org/T180183 [00:20:49] I guess moving it even earlier will be tricky (short of moving to WebStart/Maintenance, but might be doable as well?) [00:23:26] the theory is that StartProfiler needs the autoloader [00:24:26] you say "No classes or constants are used here" but that wasn't always the case [00:24:28] TimStarling: Hm... in examples and our use it only uses a string reference to the class, and is not instantiated until much later. [00:24:41] I guess in some cases people put the entire custom subclass in this file? [00:24:45] And thus need autoloader to extend? [00:27:27] says HISTORY [00:27:29] === Configuration changes in 1.18 === [00:27:36] * $wgProfiler is now a configuration array, see StartProfiler.sample for [00:27:36] details. [00:27:37] * $wgProfiling has been removed. [00:27:53] before 1.18, $wgProfiler was typically an object instance [00:28:49] it's already broken if anyone is still trying to do that, so the rationale for having it be relatively late has gone away [00:29:29] TimStarling: Ah, good, so that isn't supported anymore [00:29:31] the original rationale anyway, and I doubt there is any new rationale like people defining subclasses [00:29:31] cool :) [00:41:39] Up at https://gerrit.wikimedia.org/r/#/c/390351/ [01:57:09] how do you get those xhprof flame graphs made with XWD? [02:00:19] never mind, I think I've got it [02:10:13] these traces are quite alarming [02:11:49] here's a request that just did multiversion, WebStart.php, and a single call to $wgRequest->getText() before exiting: https://performance.wikimedia.org/xhgui/run/view?id=5a05094c3f3dfa1573bdcceb [02:12:58] why does it need to set up a user object, including hitting the database for User::idFromName()? [02:15:36] https://performance.wikimedia.org/xhgui/run/callgraph?id=5a05094c3f3dfa1573bdcceb [02:16:22] SessionManager/CA and CommonSettings apparently call User::load [02:17:29] and Setup.php calls MediaWiki\Session\SessionManager::getGlobalSession() [02:17:56] is extract2.php setting MW_NO_SESSION ? [02:18:16] no [02:20:03] out of all the little scripts in mediawiki-config/w, only static.php is using MW_NO_SESSION [02:21:20] load.php sets it as well [02:23:57] load.php works for my purposes, I just wanted a short script which would show setup time only [02:24:33] Special:VeryBlankPage [02:26:46] :) [02:31:55] actually load.php with no parameters still calls wfGetDB() 5 times [03:07:23] TimStarling: Enabling MW_NO_SESSION for extract2 should be straight-forward. Got a patch in progress? [03:20:03] TimStarling: Hm.. I think the flame graph is off. https://performance.wikimedia.org/xhgui/run/flamegraph?id=5a051817bb8544f23aeae7e9 shows main() as 380,560 us [03:20:42] whereas the main overview shows it as 58,000 [03:20:54] It's adding it all up recursively, despite them all already being inclusive [03:21:03] upstream bug :) [03:21:13] So the numbers are meaningless and the proportions somewhat magnified. [03:29:27] I noticed it was wrong, although I wasn't sure in exactly what way [03:30:14] the function table had apparently correct numbers, so I used that instead [03:33:26] both data sources show file-level code incorrectly, which may be part of your problem [03:34:48] for example ResourceLoader::respond is called by load.php, but in xhprof it is shown as being called by main(), which isn't so helpful [03:35:31] the run_init::* function names apparently have the file scope "self" code [03:41:24] TimStarling: Yeah, it may also have to do with it starting in a nested context [03:42:07] so wmf-multiversion-as-w/load.php -> 1) Multiversion, 2) require core load.php -> WebStart -> Setup -> StartProfiler [03:42:12] At that point, load.php has already started. [03:42:24] Not sure if that's the reason or not, but it might mean it's missing the "start" of that frame. [03:45:35] yeah, that would explain it [03:45:55] run_init::CommonSettings.php has a normal-looking list of children [03:49:48] So unless we use auto_prepend, it'd be best to include StartProfile from the start of a file that is the last (or only) include from its parent file. [03:50:04] So that there won't be any calls after it closes its initial frame [03:50:35] Right now after it closes the initial frame (Setup.php) it continues in the parent (WebStart) and its parent (load.php) [03:51:46] There might be a place somewhere in multiversion that matches that description. E.g. MWMultiVersion::getMediaWiki() right before the actual core include. [03:51:57] BUt yeah, if w're going with wmf-specific, auto_prepend seems claner [03:51:58] cleaner* [03:55:15] Krinkle: https://phabricator.wikimedia.org/T180192 [03:56:17] in the auto_prepend_file, don't set $wgProfiler, set $wmgProfiler or some such [03:56:23] then in StartProfiler.php you can just do [03:56:30] $wgProfiler = $wmgProfiler; [03:57:01] well, still needs an isset() for any odd CLI scripts that don't get the prepend file, but you get the idea [03:57:06] it doesn't require a patch to Setup.php that way [04:02:01] TimStarling: https://phabricator.wikimedia.org/T180183#3749864 :D [04:03:42] right [04:07:25] TimStarling: I loaded some additional clean up underneath the patch btw, given it'd conflict. I can re-arrange them if it's non-trivial. [04:07:30] https://gerrit.wikimedia.org/r/#/c/390350/1 [04:13:49] ah right [04:15:40] it's fine, I gave it +2 [04:16:29] Thx [04:48:55] I think I will convert my paste in https://gerrit.wikimedia.org/r/#/c/387959/ to a patchset, since nobody seems able to read it otherwise [05:22:19] TimStarling: He, nice scope use there, didn't think it'd be *that* easy.