delorie.com/archives/browse.cgi | search |
From: | Daniel <entropic AT mpx DOT com DOT au> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Question about long long math on intel archs |
Date: | Fri, 05 Feb 1999 13:09:33 +1100 |
Organization: | Microplex PTY LTD |
Lines: | 40 |
Message-ID: | <36BA52DD.98F5C749@mpx.com.au> |
References: | <010501be5064$215c4780$1e2d87ca AT default> |
NNTP-Posting-Host: | dialup-brisax5133.mpx.com.au |
Mime-Version: | 1.0 |
X-Trace: | news1.mpx.com.au 918183973 1606 198.142.167.133 (5 Feb 1999 03:06:13 GMT) |
X-Complaints-To: | abuse AT mpx DOT com DOT au |
NNTP-Posting-Date: | 5 Feb 1999 03:06:13 GMT |
X-Mailer: | Mozilla 4.5 [en] (Win95; I) |
X-Accept-Language: | en |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Hullo, I went back today and did a comparison of long multiplication's versus long-long's. (once again with the poor, decaying old 486) This time i did it in ms-dos mode and found that it was moderately faster than under the win95 dos-box. Did 1000000 long multiply's in 0.879121 seconds. Did 5000000 long multiply's in 4.3956 seconds. Did 10000000 long multiply's in 8.73626 seconds. Did 50000000 long multiply's in 43.7363 seconds. Did 1000000 long long multiplies in 1.7033 seconds. Did 5000000 long long multiplies in 8.35165 seconds. Did 10000000 long long multiplies in 16.8132 seconds. Did 50000000 long long multiplies in 83.9011 seconds. More important than the actual numbers is the ratio's: 1000000 long-long's/long's = 1.9375 5000000 long-long's/long's = 1.9 10000000 long-long's / long's = 1.925 50000000 long-long's / long's = 1.918 I would have expected the 64-bit operations to take twice as long, but in fact they were a bit quicker than that. There seems to be no increased overhead when multiplying long long int's. daniel. PS: i hope nobody was compiling this code with optimisation on. when i do that everything is much MUCH faster and long and long-long ops take exactly the same amount of time. I assume this is becuz gcc see's the multiplications as useless, since we never use the values of foo and bar.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |