|
raviden Novice
Joined: 02 Nov 2010 Posts: 45
|
Posted: Sat Nov 26, 2011 2:15 pm
Efficiency question |
Hey,
Which of following is better in efficiency sense?
Creating 3 triggers, with patterns that differ slighly but their command line does exacly what it should.
Creating one trigger that is general enough to catch all those three different patterns and then uses %match inside to choose which command line should it proceed.
Thanx, cheers |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sat Nov 26, 2011 5:16 pm |
separate more precise triggers are faster in most cases
but unless your script is excessively complex, you likely wont be able to tell a difference |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Nov 26, 2011 5:44 pm |
Between the 2 choices you gave the use of 3 triggers will be faster. This is because %match will have to build extra data to test the patterns each time.
For some complex patterns a speed gain can occur by making a general pattern that uses specific captures to tell the script what to do. This becomes faster because the captures become the things tested by the script, and those tests can be done faster then matching from the start of the line again. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|