Site
News
Files Visual Basic
Strings
Math
General
Properties
Memory
Methods Search
Testing Inline ASM-VB
Strings
Math
General
Memory Search
Using inline ASM
Submit!
News
Files Visual Basic
Strings
Math
General
Properties
Memory
Methods Search
Testing Inline ASM-VB
Strings
Math
General
Memory Search
Using inline ASM
Submit!
Methods vs InlineAbout 25% gain here, using Inline code.
Inline code means that instead of calling code in a sub/function to perform something, you put it directly "inline" the code,
so no method has to be called.
I've tested this with 3 Vector operations (often/always used in 3D games). Note that this code might not exactly be
representative, since I'm replacing 3 methods with just one complete inline piece of code. But you can definetly count on the
fact that inline is faster.
User contributed notes:
Code: |
Methods % faster than Inline | Methods (sec) | Inline (sec) |
26.1% | 0.246186 | 0.195249 |
22.4% | 0.245352 | 0.200503 |
26.1% | 0.246163 | 0.195158 |
22% | 0.244236 | 0.200233 |
29.9% | 0.246804 | 0.190068 |
User contributed notes:
Author: Tom (hurendo_kun at hotmail dot com) | Date: 15:05 31/05/2005 |
Placing functions inline is not always practical (since VB has no Inline statement like C/C++), but you can Find/Replace them before your final release and squeeze some extra speed out of it. |