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


Groups > comp.lang.forth > #45205

Re: Forth dictionary implementation and performance

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: Forth dictionary implementation and performance
Date 2016-01-30 17:38 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2016Jan30.183857@mips.complang.tuwien.ac.at> (permalink)
References <2016Jan29.184253@mips.complang.tuwien.ac.at> <87fuxfrfk4.fsf@jester.gateway.pace.com> <2016Jan30.145924@mips.complang.tuwien.ac.at>

Show all headers | View raw


anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>Paul Rubin <no.email@nospam.invalid> writes:
>>anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>>> The reference program took 165M cycles or 0.06s on a Xeon E3-1220....
>>>       164587102  cycles                   #      0.000 M/sec
>>>        80381803  instructions             #      0.488 IPC  
>>>        518240  branch-misses            #      0.000 M/sec
>>>      21370347  L1-dcache-load-misses    #      0.000 M/sec
>>>      45603137  L1-dcache-loads          #      0.000 M/sec
>>
>>On an i7-3770, gcc 4.7.2, perf 3.2.17, I get:
>>
>>         120962754 cycles:u                  #    0.000 GHz
>>          99843302 instructions:u            #    0.83  insns per cycle
>>            658537 branch-misses:u
>
>More instructions, more branch misses, less cycles.  My guess is that
>gcc-4.7.2 does something more efficient for the memcmp than the rep

"rep cmpsb" meant here.

>that gcc 4.4.5 uses on the reference machine.  That's one of the
>things the students found: memcmp() is slower on the reference machine
>than alternatives (it's really perverse that many groups replaced it
>with strncmp() and got a speedup).

To check this, I ran the gcc-4.4.5-generated binary on a Core i7-4790K
(Haswell) instead of the Sandy-Bridge-based Xeon, and got the
following results:

157170042      cycles:u                 
 80383211      instructions:u            #    0.51  insns per cycle        
   517709      branch-misses:u                                             
 10158800      L1-dcache-load-misses     #   31.29% of all L1-dcache hits  
 32471601      L1-dcache-loads                                         

Compiling it with gcc-4.9.2 produced:

114623017      cycles:u                 
 99904228      instructions:u            #    0.87  insns per cycle        
   646886      branch-misses:u                                             
  9831540      L1-dcache-load-misses     #   28.06% of all L1-dcache hits  
 35036262      L1-dcache-loads                                         

Running this binary on the Xeon produced:

      120441184  cycles                   #      0.000 M/sec
      102888367  instructions             #      0.854 IPC  
         613337  branch-misses            #      0.000 M/sec
       18871467  L1-dcache-load-misses    #      0.000 M/sec
       39592359  L1-dcache-loads          #      0.000 M/sec

(apparently there is also a difference in the dynamically linked
libraries between these systems that results in the difference of
executed instructions).

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2015: http://www.rigwit.co.uk/EuroForth2015/

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


Thread

Forth dictionary implementation and performance anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-29 17:42 +0000
  Re: Forth dictionary implementation and performance Paul Rubin <no.email@nospam.invalid> - 2016-01-29 16:20 -0800
    Re: Forth dictionary implementation and performance anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-30 13:54 +0000
      Re: Forth dictionary implementation and performance Paul Rubin <no.email@nospam.invalid> - 2016-01-31 11:57 -0800
        Re: Forth dictionary implementation and performance anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-01 06:47 +0000
          Re: Forth dictionary implementation and performance Paul Rubin <no.email@nospam.invalid> - 2016-02-01 00:47 -0800
            Re: Forth dictionary implementation and performance anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-01 11:13 +0000
  Re: Forth dictionary implementation and performance Bernd Paysan <bernd.paysan@gmx.de> - 2016-01-30 01:57 +0100
    Re: Forth dictionary implementation and performance anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-30 17:18 +0000
      Re: Forth dictionary implementation and performance anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-30 17:51 +0000
  Re: Forth dictionary implementation and performance Paul Rubin <no.email@nospam.invalid> - 2016-01-29 18:01 -0800
    Re: Forth dictionary implementation and performance anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-30 13:59 +0000
      Re: Forth dictionary implementation and performance anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-30 17:38 +0000
        Re: Forth dictionary implementation and performance Paul Rubin <no.email@nospam.invalid> - 2016-01-31 12:05 -0800
          Re: Forth dictionary implementation and performance Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-02-01 03:01 +0000
          Re: Forth dictionary implementation and performance anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-01 06:17 +0000
            Re: Forth dictionary implementation and performance "Elizabeth D. Rather" <erather@forth.com> - 2016-01-31 21:27 -1000
  Re: Forth dictionary implementation and performance hughaguilar96@gmail.com - 2016-01-30 15:42 -0800

csiph-web