Side navigation
#4407 closed enhancement (worksforme)
Opened March 24, 2009 10:48AM UTC
Closed December 24, 2010 04:55AM UTC
Last modified December 24, 2010 04:55AM UTC
Empty selectbox
Reported by: | Jorik | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | core | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The empty() method on a selectbox is _much_ slower then selectbox.options.length = 0; Maybe it is nice to check if the element is a selectbox, and then use the options.length way to empty the selectbox.
Attachments (1)
Change History (6)
Changed March 24, 2009 07:37PM UTC by comment:1
Changed March 24, 2009 07:41PM UTC by comment:2
My test results in FF:
- test1: 73ms
- test2: 1ms
- test3: 4ms
Changed August 09, 2009 01:42AM UTC by comment:3
component: | unfilled → core |
---|
Changed November 18, 2010 04:07AM UTC by comment:4
keywords: | → needsreview |
---|---|
status: | new → open |
We still need to clean off the data attributes. I can't get the test case to work though.
Changed December 24, 2010 04:55AM UTC by comment:5
resolution: | → worksforme |
---|---|
status: | open → closed |
The differences don't seem that large to me; I even increased the number of options. For cases where someone is updating large numbers selects at a high frequency and is willing to risk the memory leaks, they can set options.length=0.
Changed December 24, 2010 04:55AM UTC by comment:6
keywords: | needsreview |
---|
I tested whats faster; the build-in jQuery technick of a while loop and your suggestion of
Aldo your suggestion is faster then the while loop, it's not the while loop that slows it down; it's the expando management that is the 'problem'.