Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #14394

Speed Test for Comparison

From "Mel Smith" <med_cutout_syntel@aol.com>
Newsgroups comp.lang.c
Subject Speed Test for Comparison
Date 2011-12-08 10:09 -0700
Message-ID <9kc99pFurU1@mid.individual.net> (permalink)

Show all headers | View raw


Hi:

    I have included below 56 speed test results when using the C-based 
Harbour language along with the MinGw 4.6.1 C compiler

    This test package was generated by running the Harbour compiler to 
create C modules which were then compiled by the MinGw compiler, and then 
linked..

    The executable was then run to create the test results below.

    I'd be interested in getting some purely C-based test results based on 
any of the 56 tests I ran below.

    Each test below was run 1,000,000 times. The results below are stated in 
decimal seconds.

    The assignment operator is ':='  rather than '='

    Variable Name Description:


    L means a Local vrbl
    S means a Static vrbl
    M means a 'Private' Memory Vrbl
    F means a 'Field vrbl' -- that is a Field in a database
    P means a 'Public' vrbl accessible by all modules in the .exe
and
    _C means a Character String vrbl
    _N means a Numeric vrbl
    _D means a Date vrbl

    The & means a 'macro' compilation whereby the string is compiled and run 
at runtime.

Thanks.
-- 
Mel Smith

**************  test results *******************

12/08/11 09:38:05 Windows XP 5.1.2600 Service Pack 3
Harbour 3.1.0dev (Rev. 17129) MinGW GNU C 4.6.1 (32-bit) x86
THREADS: 0
N_LOOPS: 1000000
[ T000: empty loop overhead ]...................................0.08
====================================================================
[ T001: x := L_C ]..............................................0.06
[ T002: x := L_N ]..............................................0.08
[ T003: x := L_D ]..............................................0.08
[ T004: x := S_C ]..............................................0.09
[ T005: x := S_N ]..............................................0.08
[ T006: x := S_D ]..............................................0.09
[ T007: x := M->M_C ]...........................................0.06
[ T008: x := M->M_N ]...........................................0.11
[ T009: x := M->M_D ]...........................................0.09
[ T010: x := M->P_C ]...........................................0.08
[ T011: x := M->P_N ]...........................................0.09
[ T012: x := M->P_D ]...........................................0.11
[ T013: x := F_C ]..............................................0.20
[ T014: x := F_N ]..............................................0.28
[ T015: x := F_D ]..............................................0.17
[ T016: x := o:Args ]...........................................0.20
[ T017: x := o[2] ].............................................0.14
[ T018: round( i / 1000, 2 ) ]..................................0.48
[ T019: str( i / 1000 ) ].......................................1.48
[ T020: val( s ) ]..............................................0.33
[ T021: val( a [ i % 16 + 1 ] ) ]...............................0.61
[ T022: dtos( d - i % 10000 ) ].................................0.48
[ T023: eval( { || i % 16 } ) ].................................0.45
[ T024: eval( bc := { || i % 16 } ) ]...........................0.31
[ T025: eval( { |x| x % 16 }, i ) ].............................0.39
[ T026: eval( bc := { |x| x % 16 }, i ) ].......................0.31
[ T027: eval( { |x| f1( x ) }, i ) ]............................0.55
[ T028: eval( bc := { |x| f1( x ) }, i ) ]......................0.50
[ T029: eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.44
[ T030: x := &( "f1(" + str(i) + ")" ) ]........................2.63
[ T031: bc := &( "{|x|f1(x)}" ), eval( bc, i ) ]................3.02
[ T032: x := valtype( x ) +  valtype( i ) ].....................0.47
[ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........1.36
[ T034: x := a[ i % 16 + 1 ] == s ].............................0.44
[ T035: x := a[ i % 16 + 1 ] = s ]..............................0.45
[ T036: x := a[ i % 16 + 1 ] >= s ].............................0.45
[ T037: x := a[ i % 16 + 1 ] <= s ].............................0.45
[ T038: x := a[ i % 16 + 1 ] < s ]..............................0.47
[ T039: x := a[ i % 16 + 1 ] > s ]..............................0.44
[ T040: ascan( a, i % 16 ) ]....................................0.47
[ T041: ascan( a, { |x| x == i % 16 } ) ].......................3.59
[ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s,s2,a2 ]....1.11
[ T043: x := a ]................................................0.06
[ T044: x := {} ]...............................................0.13
[ T045: f0() ]..................................................0.11
[ T046: f1( i ) ]...............................................0.23
[ T047: f2( c[1...8] ) ]........................................0.17
[ T048: f2( c[1...40000] ) ]....................................0.17
[ T049: f2( @c[1...40000] ) ]...................................0.17
[ T050: f2( @c[1...40000] ), c2 := c ]..........................0.22
[ T051: f3( a, a2, s, i, s2, bc, i, n, x ) ]....................0.70
[ T052: f2( a ) ]...............................................0.17
[ T053: x := f4() ].............................................0.66
[ T054: x := f5() ].............................................0.31
[ T055: x := space(16) ]........................................0.23
[ T056: f_prv( c ) ]............................................0.50
====================================================================
[ total application time: ]....................................31.94
[ total real time: ]...........................................31.95

**************** end of test ********************************

Back to comp.lang.c | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Speed Test for Comparison "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-08 10:09 -0700
  Re: Speed Test for Comparison Richard Sanders <lnr729@gmail.com> - 2011-12-08 11:19 -0800
    Re: Speed Test for Comparison "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-08 13:13 -0700
      Re: Speed Test for Comparison "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-08 13:18 -0700
        Re: Speed Test for Comparison Seebs <usenet-nospam@seebs.net> - 2011-12-08 20:41 +0000
          Re: Speed Test for Comparison Ben Pfaff <blp@cs.stanford.edu> - 2011-12-08 12:49 -0800
            Re: Speed Test for Comparison Seebs <usenet-nospam@seebs.net> - 2011-12-08 21:53 +0000
      Re: Speed Test for Comparison Seebs <usenet-nospam@seebs.net> - 2011-12-08 20:41 +0000
  Re: Speed Test for Comparison "BartC" <bc@freeuk.com> - 2011-12-08 21:43 +0000
  Re: Speed Test for Comparison ImpalerCore <jadill33@gmail.com> - 2011-12-08 13:58 -0800
  Re: Speed Test for Comparison Keith Thompson <kst-u@mib.org> - 2011-12-08 14:58 -0800
    Re: Speed Test for Comparison "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-10 11:28 -0700
      Re: Speed Test for Comparison "BartC" <bc@freeuk.com> - 2011-12-10 21:40 +0000
        Re: Speed Test for Comparison "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-10 19:26 -0700
      Re: Speed Test for Comparison Keith Thompson <kst-u@mib.org> - 2011-12-10 13:49 -0800

csiph-web