[wp-trac] [WordPress Trac] #13615: Confusing behavior adding items to nonexistent menu

WordPress Trac wp-trac at lists.automattic.com
Sun May 30 05:24:44 UTC 2010


#13615: Confusing behavior adding items to nonexistent menu
--------------------------+-------------------------------------------------
 Reporter:  filosofo      |        Owner:  nacin 
     Type:  defect (bug)  |       Status:  closed
 Priority:  normal        |    Milestone:  3.0   
Component:  Menus         |      Version:  3.0   
 Severity:  normal        |   Resolution:  fixed 
 Keywords:  has-patch     |  
--------------------------+-------------------------------------------------

Comment(by markjaquith):

 Replying to [comment:10 filosofo]:
 > I've tested it across a number of browsers, and at best (typically in
 the slowest browsers), jQuery is only twice as slow as the host method in
 retrieving an element by ID; in the fastest modern browsers it seems to be
 at least several times slower.
 >
 > I guess I'm overdue for my promised blog post about the more general
 issue, but this particular line seems like a no-brainer: at the cost of a
 few characters you get wider support and better performance, guaranteed.

 I must have missed that fracas. The difference for this one selector can
 be measured in single digits of nanoseconds. So this one isn't going to
 make or break anything. I gather it's more of a general trend you're
 concerned about. If we want to make sure we're using the fastest way
 possible of doing simple DOM grabs or checks, I noticed that this is
 actually faster than using {{{document.getElementById()}}} in latest
 stable Firefox:

 > {{{g = function(a){return document.getElementById(a);};}}}

 For me, it consistently saved about 0.2 nanoseconds per iteration.
 Averaged 2.9 ns vs 3.1 ns for the POJ version. Unexpected, but then the
 new JS engines do some fairly insane stuff to eke out speed in function
 calls.

 And it doesn't get much shorter than {{{g()}}} :-)

 If there is a separate ticket for speeding up our JS, we can continue this
 line of investigation there.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13615#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list