Changes between Initial Version and Version 1 of Ticket #4523
- Timestamp:
- Jun 11, 2007, 4:15:14 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #4523
- Property Keywords performance added
- Property Triage Stage Unreviewed → Design decision needed
-
Ticket #4523 – Description
initial v1 1 Tucked away in NodeList.render is a fun little isinstance check, basically1 Tucked away in !NodeList.render is a fun little isinstance check, basically 2 2 {{{ 3 3 if isinstance(node, Node): … … 8 8 9 9 With the render method being a hook method for derivative classes to intercept exceptions, and add some debugging info in; two limiting points to scaling there[[BR]] 10 1) Because ForNode uses it to store strings, the isinstance is required- no other code uses it for this functionality, making me think ForNode shouldn't be forcingNodeList to do something odd, should do the job itself[[BR]]11 2) Because DebugNodeList overrides render_node, instead of render, an extra func call is involved for every node; again, single usage slows down the common usage.10 1) Because !ForNode uses it to store strings, the isinstance is required- no other code uses it for this functionality, making me think !ForNode shouldn't be forcing !NodeList to do something odd, should do the job itself[[BR]] 11 2) Because !DebugNodeList overrides render_node, instead of render, an extra func call is involved for every node; again, single usage slows down the common usage. 12 12 13 So... question is, why should ForNode use it? Have yet to find any comments/explanation code wise, only thing I can *guess* is that someone was trying to extendDebugNodeList.render_node behaviour down through a for; as said, this hurts the common case.13 So... question is, why should !ForNode use it? Have yet to find any comments/explanation code wise, only thing I can *guess* is that someone was trying to extend !DebugNodeList.render_node behaviour down through a for; as said, this hurts the common case. 14 14 15 Realize the first reaction is likely going to be another "micro-optimization is evil" comment; thing is, while it's not a huge gain like say removing dispatch.send invocations from Models.*, it's a constant waste occuring in any NodeList.render (which are common enough). Usual usage scenario I'm abusing for testing pegs it as a constant 1.4s hit against trunk 64s (26s if using my misc patches sitting in tickets); might not seem like much, but it's yet another spot where it's spinning it's wheels without reason.15 Realize the first reaction is likely going to be another "micro-optimization is evil" comment; thing is, while it's not a huge gain like say removing dispatch.send invocations from Models.*, it's a constant waste occuring in any !NodeList.render (which are common enough). Usual usage scenario I'm abusing for testing pegs it as a constant 1.4s hit against trunk 64s (26s if using my misc patches sitting in tickets); might not seem like much, but it's yet another spot where it's spinning it's wheels without reason. 16 16 17 So... why is ForNode abusingNodeList here? Oversight? Worth preserving?17 So... why is !ForNode abusing !NodeList here? Oversight? Worth preserving?