![]() Preserved Topic: Making the script smaller (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: Stockholm, Sweden |
![]() Hi, I have made a script that calculates some stuff... I just wonder if I can make it smaller in bytes? I heard u could use something with 'eval' to get the field name and then cut the script with 3/4... Am I right? |
Bipolar (III) Inmate From: London, UK |
![]() I'm guessing the easiest way to cut it down would be to set a variable for all the occurences of |
Paranoid (IV) Inmate From: Lebanon |
![]() smash, in addition to what stinx said, you can: |
Bipolar (III) Inmate From: Stockholm, Sweden |
![]() Thanks for the tips stinx and lallous! |
Paranoid (IV) Inmate From: Lebanon |
![]() since you want to save bandwidth try using tools like HTMLCompress ... |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() Using eval() function can only make your script run slower. Also, that function can't replace if statements, only thing that you can optimize is what stinx & lallous said. And in addition to all that you can also remove all whitescape characters (each character = one byte), like spaces, new lines, etc... |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() the eval() function isn't necessary. But whoever told you that was on the right track. Your script has four parts that are almost exactly the same: |
Bipolar (III) Inmate From: Stockholm, Sweden |
![]() Thank you very much for all help! |