![]() |
|
|
#1 |
|
Feb 2004
France
22·229 Posts |
On Linux, using "strace -p <mprime-PID>", I got the following.
There are a dozen or more calls to gettimeofday() every second. Maybe there is some possible performance improvement there. T. Code:
...
gettimeofday({1146054495, 848413}, {4294967176, 0}) = 0
gettimeofday({1146054495, 931584}, {4294967176, 0}) = 0
gettimeofday({1146054495, 931765}, {4294967176, 0}) = 0
gettimeofday({1146054496, 11979}, {4294967176, 0}) = 0
gettimeofday({1146054496, 12155}, {4294967176, 0}) = 0
gettimeofday({1146054496, 92190}, {4294967176, 0}) = 0
time([1146054496]) = 1146054496
gettimeofday({1146054496, 92558}, {4294967176, 0}) = 0
gettimeofday({1146054496, 175913}, {4294967176, 0}) = 0
gettimeofday({1146054496, 176095}, {4294967176, 0}) = 0
gettimeofday({1146054496, 256532}, {4294967176, 0}) = 0
gettimeofday({1146054496, 256708}, {4294967176, 0}) = 0
gettimeofday({1146054496, 339884}, {4294967176, 0}) = 0
gettimeofday({1146054496, 340067}, {4294967176, 0}) = 0
gettimeofday({1146054496, 420334}, {4294967176, 0}) = 0
gettimeofday({1146054496, 420510}, {4294967176, 0}) = 0
gettimeofday({1146054496, 501056}, {4294967176, 0}) = 0
gettimeofday({1146054496, 501229}, {4294967176, 0}) = 0
gettimeofday({1146054496, 581272}, {4294967176, 0}) = 0
gettimeofday({1146054496, 581449}, {4294967176, 0}) = 0
gettimeofday({1146054496, 661825}, {4294967176, 0}) = 0
gettimeofday({1146054496, 662002}, {4294967176, 0}) = 0
gettimeofday({1146054496, 743024}, {4294967176, 0}) = 0
gettimeofday({1146054496, 743207}, {4294967176, 0}) = 0
gettimeofday({1146054496, 823464}, {4294967176, 0}) = 0
gettimeofday({1146054496, 823641}, {4294967176, 0}) = 0
gettimeofday({1146054496, 903780}, {4294967176, 0}) = 0
gettimeofday({1146054496, 903955}, {4294967176, 0}) = 0
gettimeofday({1146054496, 984071}, {4294967176, 0}) = 0
gettimeofday({1146054496, 984248}, {4294967176, 0}) = 0
gettimeofday({1146054497, 64298}, {4294967176, 0}) = 0
gettimeofday({1146054497, 64486}, {4294967176, 0}) = 0
gettimeofday({1146054497, 147771}, {4294967176, 0}) = 0
gettimeofday({1146054497, 147954}, {4294967176, 0}) = 0
gettimeofday({1146054497, 228350}, {4294967176, 0}) = 0
gettimeofday({1146054497, 228527}, {4294967176, 0}) = 0
gettimeofday({1146054497, 308707}, {4294967176, 0}) = 0
gettimeofday({1146054497, 308883}, {4294967176, 0}) = 0
gettimeofday({1146054497, 389138}, {4294967176, 0}) = 0
gettimeofday({1146054497, 389315}, {4294967176, 0}) = 0
....
|
|
|
|
|
|
#2 | |
|
Aug 2002
32010 Posts |
Quote:
|
|
|
|
|
|
|
#3 |
|
"Oliver"
Mar 2005
Germany
45716 Posts |
noticed that, too..
seems that gettimeofday() is called twice per iteration... let me guess: your "Per iteration time" one the system where you generated that output above is about 80ms? ;) |
|
|
|
|
|
#4 |
|
Jul 2005
2·193 Posts |
Calls to gettimeofday are *VERY* cheap, it's usually implemented as a instruction to copy a timer into a register.
I knocked up a quick program that calls gettimeofday() twice in a row (to separate result buffers). The total difference in returned values for 10M iterations is 4951681 microseconds. So each call takes approximately 1/2 a microsecond. So you'll need to call it 20M times before you use up 1 second of CPU time. |
|
|
|
|
|
#5 |
|
Feb 2004
France
91610 Posts |
OK! OK! I've understood this is not a performance problem. Sorry.
"about 80ms?" I think it is 88ms on this machine. Regards, T. |
|
|
|
|
|
#6 | |
|
Jul 2005
1100000102 Posts |
Quote:
|
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mPrime over SSH | Vincanis | Information & Answers | 4 | 2011-06-30 13:36 |
| ./mprime -B in 257 | Lazlow | PrimeNet | 3 | 2008-10-29 20:40 |
| 64 bit mprime? | aaronl | Linux | 1 | 2005-11-10 16:50 |
| ECM using gmp-ecm and mprime on a P4 | geoff | Factoring | 60 | 2004-12-02 07:16 |
| Problem with mprime (Fixed with mprime -d) | antiroach | Software | 2 | 2004-07-19 04:07 |