<s>
In	O
computing	O
,	O
a	O
group	O
of	O
parallel	B-Data_Structure
arrays	I-Data_Structure
(	O
also	O
known	O
as	O
structure	B-General_Concept
of	I-General_Concept
arrays	I-General_Concept
or	O
SoA	O
)	O
is	O
a	O
form	O
of	O
implicit	B-Data_Structure
data	I-Data_Structure
structure	I-Data_Structure
that	O
uses	O
multiple	O
arrays	O
to	O
represent	O
a	O
singular	O
array	B-Data_Structure
of	O
records	O
.	O
</s>
<s>
It	O
keeps	O
a	O
separate	O
,	O
homogeneous	O
data	O
array	B-Data_Structure
for	O
each	O
field	O
of	O
the	O
record	O
,	O
each	O
having	O
the	O
same	O
number	O
of	O
elements	O
.	O
</s>
<s>
Then	O
,	O
objects	O
located	O
at	O
the	O
same	O
index	O
in	O
each	O
array	B-Data_Structure
are	O
implicitly	O
the	O
fields	O
of	O
a	O
single	O
record	O
.	O
</s>
<s>
Pointers	O
from	O
one	O
object	O
to	O
another	O
are	O
replaced	O
by	O
array	B-Data_Structure
indices	O
.	O
</s>
<s>
This	O
contrasts	O
with	O
the	O
normal	O
approach	O
of	O
storing	O
all	O
fields	O
of	O
each	O
record	O
together	O
in	O
memory	O
(	O
also	O
known	O
as	O
array	B-General_Concept
of	I-General_Concept
structures	I-General_Concept
or	O
AoS	O
)	O
.	O
</s>
<s>
For	O
example	O
,	O
one	O
might	O
declare	O
an	O
array	B-Data_Structure
of	O
100	O
names	O
,	O
each	O
a	O
string	O
,	O
and	O
100	O
ages	O
,	O
each	O
an	O
integer	O
,	O
associating	O
each	O
name	O
with	O
the	O
age	O
that	O
has	O
the	O
same	O
index	O
.	O
</s>
<s>
An	O
example	O
in	O
C	B-Language
using	O
parallel	B-Data_Structure
arrays	I-Data_Structure
:	O
</s>
<s>
in	O
Perl	B-Language
(	O
using	O
a	O
hash	O
of	O
arrays	O
to	O
hold	O
references	O
to	O
each	O
array	B-Data_Structure
)	O
:	O
</s>
<s>
Or	O
,	O
in	O
Python	B-Language
:	O
</s>
<s>
Parallel	B-Data_Structure
arrays	I-Data_Structure
have	O
a	O
number	O
of	O
practical	O
advantages	O
over	O
the	O
normal	O
approach	O
:	O
</s>
<s>
If	O
the	O
number	O
of	O
items	O
is	O
small	O
,	O
array	B-Data_Structure
indices	O
can	O
occupy	O
significantly	O
less	O
space	O
than	O
full	O
pointers	O
,	O
particularly	O
on	O
some	O
architectures	O
.	O
</s>
<s>
Sequentially	O
examining	O
a	O
single	O
field	O
of	O
each	O
record	O
in	O
the	O
array	B-Data_Structure
is	O
very	O
fast	O
on	O
modern	O
machines	O
,	O
since	O
this	O
amounts	O
to	O
a	O
linear	O
traversal	O
of	O
a	O
single	O
array	B-Data_Structure
,	O
exhibiting	O
ideal	O
locality	B-General_Concept
of	I-General_Concept
reference	I-General_Concept
and	O
cache	O
behaviour	O
.	O
</s>
<s>
However	O
,	O
parallel	B-Data_Structure
arrays	I-Data_Structure
also	O
have	O
several	O
strong	O
disadvantages	O
,	O
which	O
serves	O
to	O
explain	O
why	O
they	O
are	O
not	O
generally	O
preferred	O
:	O
</s>
<s>
They	O
have	O
significantly	O
worse	O
locality	B-General_Concept
of	I-General_Concept
reference	I-General_Concept
when	O
visiting	O
the	O
records	O
non-sequentially	O
and	O
examining	O
multiple	O
fields	O
of	O
each	O
record	O
,	O
because	O
the	O
various	O
arrays	O
may	O
be	O
stored	O
arbitrarily	O
far	O
apart	O
.	O
</s>
<s>
They	O
have	O
little	O
direct	O
language	O
support	O
(	O
the	O
language	O
and	O
its	O
syntax	O
typically	O
express	O
no	O
relationship	O
between	O
the	O
arrays	O
in	O
the	O
parallel	B-Data_Structure
array	I-Data_Structure
,	O
and	O
cannot	O
catch	O
errors	O
)	O
.	O
</s>
<s>
The	O
bad	O
locality	B-General_Concept
of	I-General_Concept
reference	I-General_Concept
can	O
be	O
alleviated	O
in	O
some	O
cases	O
:	O
if	O
a	O
structure	O
can	O
be	O
divided	O
into	O
groups	O
of	O
fields	O
that	O
are	O
generally	O
accessed	O
together	O
,	O
an	O
array	B-Data_Structure
can	O
be	O
constructed	O
for	O
each	O
group	O
,	O
and	O
its	O
elements	O
are	O
records	O
containing	O
only	O
these	O
subsets	O
of	O
the	O
larger	O
structure	O
's	O
fields	O
.	O
</s>
<s>
An	O
alternative	O
to	O
tying	O
them	O
together	O
using	O
array	B-Data_Structure
indexes	O
is	O
to	O
use	O
references	O
to	O
tie	O
the	O
portions	O
together	O
,	O
but	O
this	O
can	O
be	O
less	O
efficient	O
in	O
time	O
and	O
space	O
.	O
</s>
<s>
Another	O
alternative	O
is	O
to	O
use	O
a	O
single	O
array	B-Data_Structure
,	O
where	O
each	O
entry	O
is	O
a	O
record	O
structure	O
.	O
</s>
<s>
In	O
other	O
languages	O
it	O
may	O
be	O
feasible	O
to	O
simulate	O
this	O
by	O
declaring	O
an	O
array	B-Data_Structure
of	O
n*m	O
size	O
,	O
where	O
m	O
is	O
the	O
size	O
of	O
all	O
the	O
fields	O
together	O
,	O
packing	O
the	O
fields	O
into	O
what	O
is	O
effectively	O
a	O
record	O
,	O
even	O
though	O
the	O
particular	O
language	O
lacks	O
direct	O
support	O
for	O
records	O
.	O
</s>
<s>
Some	O
compiler	B-Application
optimizations	I-Application
,	O
particularly	O
for	O
vector	B-Operating_System
processors	I-Operating_System
,	O
are	O
able	O
to	O
perform	O
this	O
transformation	O
automatically	O
when	O
arrays	O
of	O
structures	O
are	O
created	O
in	O
the	O
program	O
.	O
</s>
