[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[task #16114] Print warning where integer overflow happens
From: |
Mohammad Akhlaghi |
Subject: |
[task #16114] Print warning where integer overflow happens |
Date: |
Sun, 4 Jun 2023 20:04:26 -0400 (EDT) |
Follow-up Comment #16, task #16114 (project gnuastro):
Thanks a lot for the nice work Siyang! I reviewed the commits and made some
additional changes in the
[https://gitlab.com/makhlaghi/gnuastro-dev/-/tree/overflowcheck overflowcheck]
branch of my development fork. Have a look at the commits messages and changes
(the good news is that the compile time is now almost identical to the
'master' branch).
To get a good statistical feeling of the effect of the overflow checks on the
run-time, I wrote the following script after installing the Gnuastro of this
branch (note that the script has to be run as root to allow cleaning the RAM).
I chose 64-bit integer to best show the difference:
type=int64
astarithmetic 10000 10000 2 makenew 100 u8 + \
20 mknoise-sigma $type -onoised-1.fits
astarithmetic 10000 10000 2 makenew 100 u8 + \
20 mknoise-sigma $type -onoised-2.fits
for i in $(seq 25); do
echo test $i
sync; echo 3 > /proc/sys/vm/drop_caches
{ time astarithmetic noised-1.fits noised-2.fits x -ojunk.fits -g1 -q; }
\
2> junk.txt
awk '/^real/{print $2}' junk.txt | sed -e's|0m||' -e's|s||' >> $type.txt
done
Here is the result as two histograms:
(file #54813)
In short: the overflow checks almost double the run-time :-(. Can you have a
look to see if you can reproduce this difference? Did I do a bad change
somewhere in my commits?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/task/?16114>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/