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!
Single vs Multi dim arraysSingle arrays are much faster.
Probably the more dimensions, the faster the single dimension array is in comparison. If I increase the number of iterations, the difference would probably get bigger as well.
User contributed notes:
Probably the more dimensions, the faster the single dimension array is in comparison. If I increase the number of iterations, the difference would probably get bigger as well.
Declarations: Code: |
Single % faster than Multi | Single (sec) | Multi (sec) |
29.6% | 0.896483 | 0.691485 |
28.6% | 1.050448 | 0.817123 |
15.6% | 0.960848 | 0.831025 |
14.5% | 0.998089 | 0.871410 |
47.6% | 1.062180 | 0.719528 |
User contributed notes:
Author: Tom (hurendo_kun at hotmail dot com) | Date: 16:06 08/06/2005 |
This is true for older chipsets, but it doesn't seem to hold for newer ones. A similar profile on my system with one-, two-, and three-dimensional arrays yielded comparable results for each. (However, this may be attributed to my dimensions, which were powers-of-two. Using powers-of-two provides better memory alignment and thus yields faster performance.) |