Date: Fri, 17 Mar 2000 20:50:33 +0100 From: Javier Bardal Prieto Subject: Re: Fastest integer type To: djgpp-workers AT delorie DOT com Message-id: <200003171950.UAA20742@golum.inforg.uniovi.es> Content-transfer-encoding: 7BIT Reply-To: djgpp-workers AT delorie DOT com salvador wrote: > Jesus Gil y Gil wrote: > > > You should run the benchmark that I posted 3 days ago > > I didn't see the benchmarks, only the results. And I think this isn't useful for > any real program. I don't know about any program that is just thousand adds in a > loop. Even more: the results are clearly different to what you get with any > complicated benchmark, the AMD K6 and PII aren't so different as your benchmark > seems to indicate. > I think the best way is to just use some "typedef BasicType int;" compile, > meassure and then try with other type. That's assuming the operations feets in > any integer size. > Are you sure your benchmarks isn't involving type conversions? (zero and sign > extend as example) this could make ints faster no matters what's the real thing. > > SET I don't know of what are you talking about when you say complicated benchmark, the benchmarks ussualy used, as Dr.Hardware, Norton Utilities (for MS-DOS) etc... Gives bad results, because these tests only tests the operations itself and not the cost of reading the operands and writing the results, and only a few reads the operands, but the really big problem is NO WRITING, becase this is the most AMD K6 FAULT!!!!, I don't know why you don't see the benchmak, may be because I send the binaries to make the process faster and the size were about 40kb, so I send know only the source and the compilation instruccions. And no there are no sign corrections, there aren't conversions not controlled. You say that this test isn't releveant because real programs don't make this operaitons very much, you are wrong, video, image and audio compression programs, 3d programs and games, 2d games, all make intensive use of this operations, and by my experience the results of the benchmarks are very very representative. Now here is the benchmark post without binaries: Due to discussions about Intel, AMD, Cyrix, etc... processors efficiency, I have done a benchmark, that I expect clarify the dudes. In my experience the AMD K6 processors have a WRITING latency very high, the same as Pentium, but Pentium II and III does not, the Pentium's II and III write at the same speed than read, the K6 reads 3 times more quickly than Pentium's II and III, but writes at the same speed than a Pentium 166. This benchmark makes a simple but very frequent task, It has two source arrays, one is the array A and the other the array B, and another array, the destination , the array C The test consists only in adding, multiplying and dividing all the elements of the array A with the correspondence in the array B, and store the result in the array C. The size of the vectors, is decreased dinamically, at the same time, the test is executed more times. This mode shows the cache efficiency. It uses arrays of chars, shorts, longs, floats, doubles and fixed point numbers, so the test is very complete. The benchkmark is in spanish, but it's very easy to understand it. I used gcc2.95.2 and Djgpp 2.03 The compiler options are: gcc -O9 -fomit-frame-pointer -funroll-loops -m386 -mcpu=i386 -march=i386 -ffast-math bench.c -obench DO NOT CHANGE IT!!!! gcc generates highly optimized code with this settings, and changing it to a specific processor model only has 2% of speed up. So for a uniform testing I recommend to do not change it. The final index reported by the test is the most generic result, and says millions of operations per second, and involves all data types, cache sizes.... Suposse you obtain an index of 9.6 for a K6-300MHz, and an index of 17.2 for a Pentium II 350MHz This index tries to tell: The Pentium II 350 processor is 17.2/9.6 = 1.8 times more powerfull that the K6-300 The previous results to the final index reveals more detailed information about the processor, cache size, integer and float performance, etc... The parameters to induce to it are two: - Memory to be used by the test: Another time I recommend to DO NOT CHANGE IT, and use a value of 8, this means 8 Mb, the larger cache size I have noticed is 2 Mb so this is sufficient, and changing it will MAKE THE RESULTS NO COMPARABLE between others with diferent size, because this affects to the final index. - Times to execute the test: I have allways used 8 times, this value can be changed without affecting the results, a larger value means more precission test, I recommend to put 8 times, so the test will be more homogeneus. EASIEST WAY TO MAKE THE TEST ON YOUR COMPUTER: I invited people to make the test in their computers, in plain dos, NO WINDOWS, and post the results. I send a zip file with the executable done and the BAT files to make the process as easy as possible, only that you must to do is: - Extract the zip file - Execute the command: execute.bat my_processor At the end of the process you will obtain a file named: my_processor.txt with the results of the test for your processor, It will be wonderfull if you post your results to this news group. I have problems posting the benchmark source, bench.c is 17kb and djgpp mail-list seems to reject it. begin 644 bench.zip M4$L#!!0``@`(`(0=;2AYAJ!DJ`P``"1!```'`!4`8F5N8V AT N8U54"0`#]U7, M.&E6S#A5>`0`%@3U`B0PK*=V$G:='>1#/2VZ1:@:88D M&X;[@D$6I40+166FW,MVZW^_Y#F415)R[,9M4G](1![J\#D\Y'E(BOPNYPF; MTY2$HJ)YN7,U>?SH.SN/Y5,O,ZD^W*1^P0]B5.6%GSWGN5(!F:*:S9.*Z$+O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