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

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

[Octave-patch-tracker] [patch #10147] interpreter: Avoid string construc


From: Petter Tomner
Subject: [Octave-patch-tracker] [patch #10147] interpreter: Avoid string construction
Date: Sat, 18 Dec 2021 09:16:18 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Follow-up Comment #3, patch #10147 (project octave):

I have split up the patch accordingly:

Patch 1 - static strings for some __get_* functions in fcn-info.cc

Patch 2 - Some const string references instead of copies

Patch 3 - Remove some redundant ""-writes

I ditched the query/process code since it got really kludgy trying to bubble
up the result
and it didn't do too much good.

Also I ditched the unordered_map:s since the speed improvement seemed
dependent on other patches.

Baseline:

function i = foo ()
  tic;
  for i = 1:100000
    i = 1+2+3+4+5+6+sin(7);
  end
  toc;
end


  37 mallocs per loop iteration

Patch 1:
  Runs about 5% faster than baseline.
  -9 mallocs per loop iteration

Patch 2:
  Unmeasurable speed improvement. 3% according to callgrind.
  -2 mallocs per iteration

Patch 3:
  Unmeasurable speed improvement but verified removes some writes. 0.6%
according to callgrind

In total:
  About 5% faster measured. Depends alot on exactly what code is executed. 13%
fewer cpu cycles 
  according to callgrind.



__run_test_suite__ runs fine* on Debian x64.

  PASS                            16970
  FAIL                                0
  XFAIL (reported bug)               31
  SKIP (missing feature)            155
  SKIP (run-time condition)          26

*(I had to disable eigs' tests since those segfaults on my machine, with or
without these patches).

(file #52529, file #52530, file #52531)
    _______________________________________________________

Additional Item Attachment:

File name: avoidstringctors_1.patch       Size:3 KB
   
<https://file.savannah.gnu.org/file/avoidstringctors_1.patch?file_id=52529>

File name: avoidstringctors_2.patch       Size:4 KB
   
<https://file.savannah.gnu.org/file/avoidstringctors_2.patch?file_id=52530>

File name: avoidstringctors_3.patch       Size:0 KB
   
<https://file.savannah.gnu.org/file/avoidstringctors_3.patch?file_id=52531>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?10147>

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




reply via email to

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