Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2013-04

TSomeRecord of array[0..ConstCount-1];

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Skybuck Flying

Hello,

Here is an idea how to speed up pascal programs by about 20%.

Currently pascal only supports:

array of structure;

However if structure of array was used this could give 20% additional performance.

the syntax for such a new feature could be:

structure of array;

So examples:

var
  vArrayOfStructure : array[0..1000] of TSomeRecord;
  vStructureOfArray : TSomeRecord of array[0..1000];

All the fields for TSomeRecord are then layed out in memory as if they were individual arrays.

This places the fields more beneficial for cache hits such is the idea.

Bye,
Skybuck.

Reply by email