Bug Tracker

Modify

Ticket #10290 (closed feature: wontfix)

Opened 20 months ago

Last modified 3 months ago

ELEMENT TRAVERSING API

Reported by: markel Owned by:
Priority: low Milestone: 2.0
Component: traversing Version: git
Keywords: Cc:
Blocking: Blocked by:

Description (last modified by rwaldron) (diff)

 http://ejohn.org/blog/element-traversal-api/

Three years past, now all major browser are supporting element traversing api. Maybe it's time to reconsider? In some cases, this properties can noticeable increase iterating speed --

nextAll(  http://jsperf.com/element-traversing-nextall-with-obstacles ),

children(  http://jsperf.com/element-traversing-children-with-obstacles ),

siblings(  http://jsperf.com/element-traversing-siblings-with-obstacles ).

In some cases, speed increase is less noticeable --

nextAll(  http://jsperf.com/element-traversing-nextall ),

children(  http://jsperf.com/element-traversing-children ),

siblings(  http://jsperf.com/element-traversing-siblings ).

Or practically does not exits --

parents(  http://jsperf.com/element-traversing-parents-with-obstacles ).

Change History

comment:1 Changed 20 months ago by markel

comment:2 Changed 20 months ago by anonymous

The last perftest does not work on ipad,... Type error thrown

comment:3 Changed 20 months ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to wontfix
  • Status changed from new to closed
  • Component changed from unfiled to traversing

Three years have passed and we still have to support IE6,7,8 the only difference is that now we're adamantly _not_ writing any more feature code for those browsers.

comment:4 Changed 20 months ago by rwaldron

  • Keywords 1.8-discuss added
  • Milestone changed from None to 1.8

I'm actually reopen this for 1.8 discussion

comment:5 Changed 20 months ago by markel

If browser are supporting new api - we use it, if it don't - we use the old one. Like it shown in pull request. Like it always has, when people start working with new api's.

comment:6 Changed 20 months ago by rwaldron

  • Status changed from closed to reopened
  • Resolution wontfix deleted
  • Description modified (diff)

comment:7 Changed 20 months ago by markel

About iPad thing --
It's nothing wrong with pull request, it's because in test i use "$.noConflict" instead of "jQuery.noConflict" test here  http://jsperf.com/element-traversing-parents-with-obstacles-2 it's should be fine.

comment:8 Changed 20 months ago by rwaldron

comment:9 Changed 20 months ago by anonymous

Rick, in ticket discription all test are fine, except the last one ( and problem exist only on iPad ), without them, you cannot see speed increase, they should be there.

comment:10 Changed 20 months ago by anonymous

And why did you removed reference to the post? Now text looks kinda silly.

comment:11 Changed 20 months ago by rwaldron

Not on purpose, sorry... that seems to happen when I post from my mobile... I'll fix it when I get home from NYC tonight

comment:12 Changed 20 months ago by timmywil

  • Status changed from reopened to open

comment:13 Changed 20 months ago by dmethvin

@markel, is there some perf test other than the one in comment 7? It doesn't look like there is any performance benefit.

comment:14 Changed 20 months ago by markel

Yes of cource, test in comment for "parents" method, with it you got nothing, but for others you got something. See http://bugs.jquery.com/ticket/10290#comment:9 and http://bugs.jquery.com/ticket/10290#comment:11

You can see those test in history of ticket description -- http://bugs.jquery.com/ticket/10290?action=diff&version=6

I guess Rick forgot to update the ticket.

comment:15 Changed 20 months ago by dmethvin

  • Description modified (diff)

I restored the links.

comment:16 Changed 18 months ago by jaubourg

  • Description modified (diff)

+0, I hate to see a new code path... even if perf is twice as good, what is the actual perf gain in real-life apps?

comment:18 Changed 18 months ago by dmethvin

-1, Isolated perfs look good, but the current code is no slouch and traversing isn't common enough to justify the size increase and extra code paths.

comment:19 Changed 18 months ago by markel

@jaubourg its pretty hard or maybe even not possible to distinguish traversing methods perf, from others methods perf (DOM manipulations, event attach, etc.) in real-live code, you always use them together, because if you travers, you got a reason for it, but it does not mean they will not have final impact on your app, that makes it slow.

@dmethvin maybe you meant that traverse method is not bottleneck in most apps? They very common by themselves. You already have extra code paths for IE, this is the exactly the same thing. Current code is not a slouch, but like i mentioned before, if you use traverse methods one after another, they might became slow --  http://jsperf.com/etapi-cumulative-effect

comment:20 Changed 17 months ago by mikesherov

-1, I'd need a real world example showing element traversal being the bottleneck in a particular case to support this. All of the perfs mentioned in this ticket are either isolated or contrived. I'm being earnest when I say show me a real example... perhaps I can be swayed.

comment:21 Changed 17 months ago by markel

jQuery.fn.closest and jQuery.fn.parents is good example btw. Very diffrent code paths, very diffrent speed results, jQuery.fn.closest implementation add a lot more extra bytes and jQuery.fn.parents is no slouch too --  http://jsperf.com/closest-vs-parents

And now, can you find a real-life code example that justifies jQuery.fn.closest existence? Apps that bottlenecking on jQuery.fn.parents?

This example is almost exactly like my Element Traversing API implementation. Even speed results, code paths and amount of bytes is comparable. Same pros, same cons. And yet...

comment:22 Changed 17 months ago by timmywil

-1, fc

comment:23 Changed 17 months ago by rwaldron

  • Description modified (diff)

-1

comment:24 Changed 16 months ago by dmethvin

  • Keywords 1.8-discuss removed
  • Status changed from open to closed
  • Resolution set to wontfix
  • Milestone changed from 1.8 to None

Vote result was negative for 1.8.

comment:25 Changed 11 months ago by dmethvin

  • Status changed from closed to reopened
  • Resolution wontfix deleted

Reopening for possible inclusion in 2.0; Orkel has volunteered.

comment:26 Changed 11 months ago by dmethvin

  • Status changed from reopened to open
  • Milestone changed from None to 2.0

comment:27 Changed 8 months ago by dmethvin

  • Type changed from enhancement to feature

Bulk change from enhancement to feature.

comment:28 Changed 3 months ago by orkel

  • Status changed from open to closed
  • Resolution set to wontfix

Fix was commited to 2.0 beta ( 65bdfbf), but it was reverted, see #13265.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.