Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
base system
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
14 Jun 2007 at 18:21 UTC
Updated:
13 Sep 2007 at 16:34 UTC
Jump to comment: Most recent file
I was noticing an extra array_shift() in the newly updated conf_init() function and I did a google search for performance differences and found this: http://webdevlogs.com/2007/05/11/array-shift-is-slower-than-i-thought
I will do a code search for other instances of array_shift() and provide a patch later.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | less_array_shift_1.patch | 2.62 KB | chx |
| #2 | less_array_shift_0.patch | 16.21 KB | chx |
| #1 | less_array_shift.patch | 16.19 KB | chx |
Comments
Comment #1
chx commentedfixed cache problems with PostgreSQL and yet, MySQL performance suffers ever since. I removed array_shift and preg_replace_callback from db_query for mysql. Also removed from bootstrap and module inc -- the critical path (ie. the code ran to serve a cached page) now does not have array_shift.
Comment #2
chx commentedLet's try this version, which happens to work somewhat unlike the above :)
Comment #3
chx commentedNaturally, more patches will be needed to remove 'em all.
Comment #4
chx commentedI can't load webdevlogs but the google cache of the original post still exists. I now simplified the patch to just removing array_shifts from bootstrap and module.
Comment #5
kevin francis commentedTested chx's patch by creating several nodes of page and story types and it works without problems.
Comment #6
wim leersRTBC
Comment #7
gábor hojtsyIt would be great to see that blog post before doing a commit on this.
Comment #8
chx commentedknock, knock. Is this thing on? Um. Anyone reads what I type? I doubt. Care to reread #4 ?
Comment #9
dvessel commentedtested, works here too.
Maybe a follow up patch is in order. theme() uses it and it's iterated quite often.
Comment #10
gábor hojtsyOK, read up on the google cached text. Admittedly, it looks like we are better avoiding array_shift(), although I doubt much of this would show a difference in a benchmark. Nobody said he tried to benchmark.
Anyway, it saves us some cycles, and I don't think the code becomes any significantly unreadable, so committed.
Comment #11
(not verified) commented