As suggested, just benchmark anytime you want to figure out which is faster. To benchmark, you need to do a lot of repetitions and use $ticks to calculate it.

Example:
Code:
alias SpeedTest {
  ;Test 1
  var %ticks = $ticks, %cnt = 1
  while (%cnt <= 20000) {
    var %ex = $remove(sho.#chan,sho.)
    inc %cnt
  }
  echo -a Using Remove: $calc($ticks - %ticks)

  ;Test 2
  var %ticks = $ticks, %cnt = 1
  while (%cnt <= 20000) {
    var %ex = $gettok(sho.#chan,-1,46)
    inc %cnt
  }
  echo -a Using Gettok: $calc($ticks - %ticks)

  ;Test 3
  var %ticks = $ticks, %cnt = 1
  while (%cnt <= 20000) {
    var %ex = $left(sho.#chan,-4)
    inc %cnt
  }
  echo -a Using Left: $calc($ticks - %ticks)

  ;Test 4
  var %ticks = $ticks, %cnt = 1
  while (%cnt <= 20000) {
    var %ex = $mid(sho.#chan,5-)
    inc %cnt
  }
  echo -a Using Mid: $calc($ticks - %ticks)
}


Note that you can divide your $calc by 1000 if you want it in seconds instead of milliseconds, but it doesn't really matter.

My own tests show (after 4 tests):
$Remove: 1062, 1031, 1031, 1015
$Gettok: 1078, 1032, 1031, 1031
$Left: 1047, 1000, 1000, 985
$Mid: 1078, 1015, 1000, 1000

Just to make it easier to see, here's an average of the 4 tests:
$Remove: 1034.75
$Gettok: 1043
$Left: 1008
$Mid: 1023.25

So, just from those 4 tests at 20,000 repetitions, you can see that $Left is the fastest on average out of the 4 methods I tested. $Mid tends to be second fastest, though it was the slowest in the first test. $Remove is third and $Gettok is slightly slower or equal to $Remove.

You can perform a similar test on ANY kind of operation you want to test speed on. It isn't hard to adjust this test to work with any other command. Just replace the var lines with whatever you are testing and increase or decrease the number of tests depending on the number of methods you are testing.


Invision Support
#Invision on irc.irchighway.net