![]() |
|
|
#1
|
|||
|
|||
|
i have a javascript code that huge enough (because so many loop & create new element
).does anyone know how to make a javascript program can run faster? does anyone know/have program that can simplify my javascript program (maybe a program that automatically remove something not important in javascript code like remarks & indentation) so my javascript program's size can be smaller and faster to load from internet? |
|
#2
|
|||
|
|||
|
avoid nested loops, recursive stuff and do your comparisons of arrays on sorted arrays instead of n^2 comps.
ie: code better. |
|
#3
|
|||
|
|||
|
Are you collecting info from a form?
If so you could maybe try collecting some of the information using a server side script first and then using this information to reduce the amount of javascript that you need to run? |
|
#4
|
||||
|
||||
|
maybe you can post your code here, we'll see what can be done to improve it
|
|
#5
|
||||
|
||||
|
I have noticed that javascript doesn't scale that well. If your arrays start to get pretty big, the client machine wil choke. I also agree with the loops and nesting.
__________________
$$$ WTB: Health related links and blog posts. $$$ |
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| can javascript run faster? | totally beginner | JavaScript | 0 | Jun 23rd 2005 12:30 am |
| Everything Should Be Faster | digitalpoint | Suggestions & Feedback | 16 | May 1st 2005 11:50 am |
| Googld add new pages faster | hurricane_sh | 9 | Nov 24th 2004 3:19 am | |
| Isn't it possible Google's PR update just can't go any faster ? | Percept | 18 | Sep 17th 2004 12:47 pm | |