Closed (fixed)
Project:
Drupal core
Component:
node.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Jan 2004 at 15:59 UTC
Updated:
16 Jan 2004 at 17:20 UTC
Jump to comment: Most recent file
This is a quite simple fix, though it makes Drupal pages appear much faster displaying nodes not having different teasers and bodies. check_output() is expensive, and there is no point in executing all the filters on the same text since the output will be the same... This makes pages displaying nodes not having different bodies and teasers display significantly faster (have not measured, but I think this is not a question).
If this is committed, other modules need to be fixed too. Forum.module has a very similar code part for example, which I have complained about before...
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | Drupal-fix.check.output.speeds.patch | 3.79 KB | gábor hojtsy |
| Drupal-increase.node.view.speed.patch | 719 bytes | gábor hojtsy |
Comments
Comment #1
gábor hojtsyUps, this should have the "patch" status...
Comment #2
Kjartan commentedPS: One minor coding standard thing, } else { needs a line break after the }.
Comment #3
gábor hojtsyAs far as I see, this problem does not warrant a new patch, since Dries nearly always edits the diffs... So the patch is still up :) (BTW I'll take care of coding standards better next time).
Comment #4
dries commentedCommitted this patch and modified the code to conform the coding standards. Thanks.
Comment #5
gábor hojtsyAs I have written, there are more like this (at least one in forum.module), so I'll provide more patches here...
Comment #6
gábor hojtsySince this approach was accepted, here is a more general fix, which includes lots of other modules having the teaser and body check_output() calls. I have introduced a new node_check() function, which prepares the teaser and the body.
I don't like the naming of check_output(), so I am not generally friendly with the naming of node_check(), but I have used this name to be consistent with the current naming of check_output()...
This patch will increase the speed of forum pages as well as many other parts of Drupal, where nodes are displayed having only a body (=teaser).
Comment #7
gábor hojtsyComment #8
dries commentedHow about
node_prepare()ornode_prepare_content? The namenode_check()is not really explanatory IMO.Comment #9
gábor hojtsyWell, node_prepare() is fine, you can search&replace in the contents of the patch.
But then it might be a good idea to rename check_output() to prepare_text() or something more appropriate after applying this patch ;) check_output() does not make much sense either, since it mostly runs the filters on the text, and does not do much checking...
Comment #10
dries commentedCommitted to HEAD using
node_prepare(). Thanks Goba.I agree that
check_output()is a bad name though it is probably worth noting that it used to be a good name. Renamingcheck_output()should probably be covered by a seperate issue.Comment #11
(not verified) commented