gnudatalanguage / gdl

GDL - GNU Data Language
GNU General Public License v2.0
274 stars 61 forks source link

OSX Apple M1 (at least) does operations on ASSOC variables slowly ON THE SECOND CALL #1767

Open GillesDuvert opened 5 months ago

GillesDuvert commented 5 months ago

See this:

GDL>  a = BINDGEN(512, 512)&aa = ASSOC(1, a)&nrep=120&OPENW, 1,'test.dat', 512,initial=512L*nrep&tic&FOR i = 0, nrep - 1 DO aa[i] = a&FOR i = 0, nrep - 1 DO a = aa[i]&toc& close,1 &file_delete,'test.dat'
% Time elapsed : 0.067583799 seconds.
GDL> a = BINDGEN(512, 512)&aa = ASSOC(1, a)&nrep=120&OPENW, 1,'test.dat', 512,initial=512L*nrep&tic&FOR i = 0, nrep - 1 DO aa[i] = a&FOR i = 0, nrep - 1 DO a = aa[i]&toc& close,1 &file_delete,'test.dat'
% Time elapsed : 1.0773981 seconds.

It happens only for aa being an ASSOC, only at the second call (so a mechanism --- file access --- is flawed on OSX), and only on OSX (clang?). (BTW ASSOC seems a great way to get persistent data, I wonder if anybody use it)