mIRC Home    About    Download    Register    News    Help

Print Thread
#193503 20/01/08 03:45 AM
Joined: Jun 2006
Posts: 79
B
Babel fish
OP Offline
Babel fish
B
Joined: Jun 2006
Posts: 79
Is it using to many |, {, and } slightly slower the scripts. Can you provide with some prove or speed check. Thanks

Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
| is quite the invalid question.

Unnecessary {'s and }'s do.

But who uses { { } }?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You can make your own speed check on anything you want. It's very easy and saves having others do it for you.

A basic speed check looks like this:
Code:
alias speedcheck1 {
  var %ticks = $ticks, %c = 1
  while(%c <= 20000) {
    if (1 = 1) { var %t = 1 }
    inc %c
  }
  echo -a Time: $calc($ticks - %ticks)
}
alias speedcheck1 {
  var %ticks = $ticks, %c = 1
  while(%c <= 20000) {
    if (1 = 1) var %t = 1
    inc %c
  }
  echo -a Time: $calc($ticks - %ticks)
}


The only change is the IF line. Run those 2 and you'll get the difference between using or not using {}'s in that line. Replace the line with other comparisons as needed. Note that the time echoed at the end is in miliseconds, but it doesn't really matter... you're just looking to see a difference. Note that you should always run the tests multiple times to get an accurate result.

EDIT: What you use for the IF line doesn't really matter. It's just a command that you put there to compare with. As you were asking about {}'s, it just needed a command that could be used with or without {}'s, so I used the IF. As long as it's the same thing other than what you're comparing, it can be just about anything and can be multiple lines.

Last edited by Riamus2; 20/01/08 11:19 AM.

Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard