I try factor 5742507205757425072053 = 371974025293448409664461 using Boost cpp_int.hpp
My sample: https://gist.github.com/borneq/e04ca7a23956fa51436a085a3b9b528b
GCC (MinGW) release give me 0.201 s. (i3 3.6 GHZ), VC++: 0.053 s and VC++ 64 bit: 0.0367 s!
But I trying compile under Linux (despite Linux is under VirtualBox) and I get:... 0.0246 s!
If I turn off optimalizations : Linux: 0.18 s Windows 0.56 s
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well the way that you are benchmarking is rather bogus. You need to remove the insanely (relatively) slow console write operations to get an accurate read on if there is actually an issue. My guess is that the console writes are adding overhead due to whatever reason (perhaps the the gcc build's std libraries not optimized, debug flags being enabled in string code, whatever). In addition, for benchmarking, 10 iterations is hardly enough to get an accurate read on what is going on. You should probably keep track of best, worst, average, and median case times. But first, remove the cout statements.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I removed console writing and time still slow. Is 10 iterations, I choose best. Why gcc under VirtualBox Linux is much faster? I don't know if MinGW is slower with standalone user programs or with Boost library. Who else does similar comaprisons: Linux and Windows?
Last edit: borneq 2016-10-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I use AMD CodeXL and saw, that function divide_unsigned_helper has only 13.3% of time, but more have functios:
pthread_setspecific 17.7778 %
pthread_spin_lock, 17.7778 %
__pthread_self_lite, 12.2222 %
pthread_spin_unlock, 11.1111 %
Problem is with threads (pthread) with Windows?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
we had (and still have) some strong need in improving speed of
winpthread. I am not sure which version of it, you are using? I know
that spinlocks, and mutexes got much faster on our master. I assume
that those changes weren't backported to older branches.
Nevertheless, working on improvement for this library is most welcome.
I use AMD CodeXL and saw, that function divide_unsigned_helper has only
13.3% of time, but more have functios:
pthread_setspecific 17.7778 %
pthread_spin_lock, 17.7778 %
__pthread_self_lite, 12.2222 %
pthread_spin_unlock, 11.1111 %
Problem is with threads (pthread) with Windows?
Boost program is much slower with Windows than with Linux
I try factor 5742507205757425072053 = 371974025293448409664461 using Boost cpp_int.hpp
My sample: https://gist.github.com/borneq/e04ca7a23956fa51436a085a3b9b528b
GCC (MinGW) release give me 0.201 s. (i3 3.6 GHZ), VC++: 0.053 s and VC++ 64 bit: 0.0367 s!
But I trying compile under Linux (despite Linux is under VirtualBox) and I get:... 0.0246 s!
If I turn off optimalizations : Linux: 0.18 s Windows 0.56 s
Well the way that you are benchmarking is rather bogus. You need to remove the insanely (relatively) slow console write operations to get an accurate read on if there is actually an issue. My guess is that the console writes are adding overhead due to whatever reason (perhaps the the gcc build's std libraries not optimized, debug flags being enabled in string code, whatever). In addition, for benchmarking, 10 iterations is hardly enough to get an accurate read on what is going on. You should probably keep track of best, worst, average, and median case times. But first, remove the cout statements.
I removed console writing and time still slow. Is 10 iterations, I choose best. Why gcc under VirtualBox Linux is much faster? I don't know if MinGW is slower with standalone user programs or with Boost library. Who else does similar comaprisons: Linux and Windows?
Last edit: borneq 2016-10-03
I use AMD CodeXL and saw, that function divide_unsigned_helper has only 13.3% of time, but more have functios:
pthread_setspecific 17.7778 %
pthread_spin_lock, 17.7778 %
__pthread_self_lite, 12.2222 %
pthread_spin_unlock, 11.1111 %
Problem is with threads (pthread) with Windows?
Hello,
we had (and still have) some strong need in improving speed of
winpthread. I am not sure which version of it, you are using? I know
that spinlocks, and mutexes got much faster on our master. I assume
that those changes weren't backported to older branches.
Nevertheless, working on improvement for this library is most welcome.
Regards,
Kai
2016-10-05 3:28 GMT+02:00 borneq borneq@users.sf.net: