Side navigation
#10290 closed feature (wontfix)
Opened September 16, 2011 12:06AM UTC
Closed February 28, 2013 04:49PM UTC
ELEMENT TRAVERSING API
Reported by: | markel | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 2.0 |
Component: | traversing | Version: | git |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
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 ).
Attachments (0)
Change History (27)
Changed September 16, 2011 12:09AM UTC by comment:1
Changed September 16, 2011 01:03AM UTC by comment:2
The last perftest does not work on ipad,... Type error thrown
Changed September 16, 2011 01:17AM UTC by comment:3
component: | unfiled → traversing |
---|---|
priority: | undecided → low |
resolution: | → wontfix |
status: | new → closed |
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.
Changed September 16, 2011 01:33AM UTC by comment:4
keywords: | → 1.8-discuss |
---|---|
milestone: | None → 1.8 |
I'm actually reopen this for 1.8 discussion
Changed September 16, 2011 10:34AM UTC by comment:5
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.
Changed September 16, 2011 01:57PM UTC by comment:6
description: | http://ejohn.org/blog/element-traversal-api/ [[BR]] \ 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 -- \ [[BR]] \ nextAll( http://jsperf.com/element-traversing-nextall-with-obstacles ), \ [[BR]] \ children( http://jsperf.com/element-traversing-children-with-obstacles ), \ [[BR]] \ siblings( http://jsperf.com/element-traversing-siblings-with-obstacles ). \ \ In some cases, speed increase is less noticeable -- \ [[BR]] \ nextAll( http://jsperf.com/element-traversing-nextall ), \ [[BR]] \ children( http://jsperf.com/element-traversing-children ), \ [[BR]] \ siblings( http://jsperf.com/element-traversing-siblings ). \ \ Or practically does not exits -- \ [[BR]] \ parents( http://jsperf.com/element-traversing-parents-with-obstacles ). → [[BR]] \ 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 -- \ [[BR]] \ nextAll( ), \ [[BR]] \ children( ), \ [[BR]] \ siblings( ). \ \ In some cases, speed increase is less noticeable -- \ [[BR]] \ nextAll( ), \ [[BR]] \ children( ), \ [[BR]] \ siblings( ). \ \ Or practically does not exits -- \ [[BR]] \ parents( ). |
---|---|
resolution: | wontfix |
status: | closed → reopened |
Changed September 16, 2011 02:59PM UTC by comment:7
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.
Changed September 16, 2011 04:02PM UTC by comment:8
More reference material: http://ejohn.org/files/jquery.traverse.js
Changed September 17, 2011 04:05AM UTC by comment:9
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.
Changed September 17, 2011 04:12AM UTC by comment:10
And why did you removed reference to the post? Now text looks kinda silly.
Changed September 18, 2011 03:08PM UTC by comment:11
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
Changed September 20, 2011 02:21PM UTC by comment:12
status: | reopened → open |
---|
Changed September 28, 2011 02:15AM UTC by comment:13
@markel, is there some perf test other than the one in comment 7? It doesn't look like there is any performance benefit.
Changed September 28, 2011 04:54AM UTC by comment:14
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.
Changed October 14, 2011 03:55PM UTC by comment:15
description: | [[BR]] \ 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 -- \ [[BR]] \ nextAll( ), \ [[BR]] \ children( ), \ [[BR]] \ siblings( ). \ \ In some cases, speed increase is less noticeable -- \ [[BR]] \ nextAll( ), \ [[BR]] \ children( ), \ [[BR]] \ siblings( ). \ \ Or practically does not exits -- \ [[BR]] \ parents( ). → 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 ). \ |
---|
I restored the links.
Changed December 13, 2011 04:12PM UTC by comment:16
description: | 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 ). \ → 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 ).\ |
---|
+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?
Changed December 13, 2011 06:23PM UTC by comment:17
-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.
Changed December 13, 2011 07:20PM UTC by comment:18
@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
Changed December 14, 2011 01:22AM UTC by comment:19
-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.
Changed December 14, 2011 01:37AM UTC by comment:20
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...
Changed December 14, 2011 04:06PM UTC by comment:21
-1, fc
Changed December 19, 2011 05:29PM UTC by comment:22
description: | 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 ).\ → 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 ). \ |
---|
-1
Changed January 18, 2012 03:31AM UTC by comment:23
keywords: | 1.8-discuss |
---|---|
milestone: | 1.8 → None |
resolution: | → wontfix |
status: | open → closed |
Vote result was negative for 1.8.
Changed July 06, 2012 09:17PM UTC by comment:24
resolution: | wontfix |
---|---|
status: | closed → reopened |
Reopening for possible inclusion in 2.0; Orkel has volunteered.
Changed July 06, 2012 09:18PM UTC by comment:25
milestone: | None → 2.0 |
---|---|
status: | reopened → open |
Changed September 09, 2012 01:11AM UTC by comment:26
type: | enhancement → feature |
---|
Bulk change from enhancement to feature.
Pull request -- https://github.com/jquery/jquery/pull/507