Ticket #4311 (closed enhancement: fixed)
remove "parseInt" and speed up some div
| Reported by: | roviury | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | unfiled | Version: | 1.3.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
remove "parseInt": parseInt(x,10) = (x-0) but (x-0) is faster
the lines is the problem refer to... 1048:
(parseInt( value ) + == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); (( value -0 ) + == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
1267:
| 0; |
| 0; |
4200-4201:
| 0, |
| 0; |
| 0, |
| 0; |
4205-4206:
| 0, |
| 0; |
| 0, |
| 0; |
4252-4253:
| 0, |
| 0; |
| 0, |
| 0; |
speed up some div: x/100 = x * 1/100 = x * 0.01 but *0.01 faster than /100 (in most browser can speed up, even if not, it must not speed down) ps.why is some div? the dividend must be constant!
1052: (parseFloat( elem.filter.match(/opacity=([)]*)/)[1] ) / 100) + : (parseFloat( elem.filter.match(/opacity=([)]*)/)[1] ) * 0.01) + :
Attachments
Change History
Changed 4 years ago by roviury
-
attachment
jquery-1.3.2_.js
added
comment:1 Changed 4 years ago by roviury
remove "parseInt": parseInt(x,10) = (x-0) but (x-0) is faster
the lines is the problem refer to...
1048:
(parseInt( value ) + == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); (( value -0 ) + == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
1267 :
| 0; |
| 0; |
4200-4201 :
| 0, |
| 0; |
| 0, |
| 0; |
4205-4206 :
| 0, |
| 0; |
| 0, |
| 0; |
4252-4253 :
| 0, |
| 0; |
| 0, |
| 0; |
speed up some div : x/100 = x * 1/100 = x * 0.01 but *0.01 faster than /100 (in most browser can speed up, even if not, it must not speed down) ps.why is some div? the dividend must be constant!
1052 : (parseFloat( elem.filter.match(/opacity=([)]*)/)[1] ) / 100) + : (parseFloat( elem.filter.match(/opacity=([)]*)/)[1] ) * 0.01) + :
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

improvement