octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #60928] Performance of sort unexpectedly slow


From: Rik
Subject: [Octave-bug-tracker] [bug #60928] Performance of sort unexpectedly slow for DIM=2
Date: Mon, 16 Aug 2021 16:08:33 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36

Follow-up Comment #14, bug #60928 (project octave):

The discrepancy in timings for dimension 1 was an artifact of testing.  The
first sort call engaged the CPU and the extra load caused the CPU frequency to
spike.  The speed remained high during the remainder of the test which meant
that the subsequent sorts looked better.  I threw in an extra call to sort()
before the benchmarking just to have things be even.  The test code is now


ND = ndims (sdata);

## Do a sort just to get CPU cranking
sort (sdata, i);

for i = 1 : ND
  tic
  sort (sdata, i);
  bm(i) = toc;
endfor

for i = 1 : ND
  printf ("DIM%d: %f\n", i, bm(i))
endfor


Results are


DIM1: 0.033301
DIM2: 0.036282
DIM3: 0.035667
DIM4: 0.145048


which makes more sense.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60928>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]