Overhead of private array initialization at module or global scope

Given an array like

private const fred = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ];

at global or module scope, its there only a one-time initialization overhead at run-time start?

Not urgent. Just need it for some documentation.

Hi Damian —

Yes, that's right. And since it's declared const, that one-time overhead will include making sure each locale its own, local copy of fred to avoid communication within the program when any locale tries to access its elements.

-Brad

1 Like