Author |
Topic: Arrays of Structures, Plus... (Read 1176 times) |
|
rtr2
Guest
|
 |
Re: Arrays of Structures, Plus...
« Reply #3 on: Nov 9th, 2014, 3:49pm » |
|
on Nov 9th, 2014, 1:58pm, Matt wrote:| A rudimentory test suggested around a 2% increase in speed when using Struct{(n)}.var% over Struct.var%(n). |
|
Somewhat surprising. In BB4W v6.beta10:
| Platform | Struct.var%(n) | Struct{(n)}.var% | | IDE | 128 cs | 130 cs | | Compiled | 123 cs | 125 cs | | REM!Fast | 96 cs | 98 cs |
But then speed shouldn't really be the deciding factor! And of course much more memory is used by the second option (12 bytes per array element instead of 4).
Richard.
|
| « Last Edit: Nov 9th, 2014, 4:02pm by rtr2 » |
Logged
|
|
|
|
Matt
Developer
member is offline


Gender: 
Posts: 210
|
 |
Re: Arrays of Structures, Plus...
« Reply #4 on: Nov 9th, 2014, 8:01pm » |
|
on Nov 9th, 2014, 3:49pm, g4bau wrote:| And of course much more memory is used by the second option (12 bytes per array element instead of 4). |
|
That's definitely a more useful thing to know. I didn't occur to me that the difference in memory useage would be that much. The program uses thousands rather than ten, so this is worth noting.
Thanks
Matt
p.s. is the REM!Fast a v6 directive? I can't find it in the help.
|
| « Last Edit: Nov 9th, 2014, 8:05pm by Matt » |
Logged
|
|
|
|
|