04.07.2015, 16:17
Quote:
Most of these optimizations are too minute to make a big a noticeable impact. Removing 2 machine code instructions just isnt worth it. If one cares about performance - pawn isnt the language of choice.
It entirely depends on the natives implementation and your use case. Say you wanted to find a substring, you would probably use strfind. The native uses a linear algorithm, but it can be done much faster with, say, kmp with the cost of a little more pre-calculation. |
Just ****** Abstract Machine, read about it and you'll realize why abstract machines are very slow. The virtual machine has lot of work to do for PAWN Code. PAWN Code is executed by the virtual machine whereas native functions directly run on your real computer.
Just to give you an idea how fast natives can be, here is a custom strcpy functions vs strcat.
http://pastebin.com/Y7RJ21tw
Results:
native: 697,700,718,705
non-native:5484,5422,5507,5562
Mind blown?
Quote:
Most of these optimizations are too minute to make a big a noticeable impact. Removing 2 machine code instructions just isnt worth it. If one cares about performance - pawn isnt the language of choice.
|
I think "Most of these optimizations are too minute" needs to be changed to "Few of these optimizations are too minute".