#4928: Add primops for copying/cloning an array
------------------------------+---------------------------------------------
  Reporter:  tibbe            |          Owner:  simonmar        
      Type:  feature request  |         Status:  patch           
  Priority:  normal           |      Milestone:  7.4.1           
 Component:  Runtime System   |        Version:  7.0.1           
Resolution:                   |       Keywords:                  
  Testcase:                   |      Blockedby:                  
Difficulty:                   |             Os:  Unknown/Multiple
  Blocking:                   |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown     |  
------------------------------+---------------------------------------------

Comment(by tibbe):

 I've attached the beginnings of a benchmark harness. For now it only
 exercises `copyArray#` and `thawArray#`. Usage:

 {{{
 $ ./inplace/bin/ghc-stage2 -O2 ArrayCopyBench.hs -o bench
 $ ./bench
 Usage: bench BENCHMARK ARRAYSIZE ITERS
 $ ./bench thawArray# 32 1000000
 thawArray#: 0.040091s
 }}}

 Using this benchmark and Linux's perf events we now have a better idea of
 where the time is spent:

 {{{
 $ perf record -f ./bench thawArray# 32 10000000
 thawArray#: 0.408859s
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.095 MB perf.data (~4160 samples) ]
 $ perf report
 # Samples: 4100
 #
 # Overhead          Command        Shared Object  Symbol
 # ........  ...............  ...................  ......
 #
     37.05%            bench  /lib/libc-2.11.1.so  [.] memcpy
     36.78%            bench  ./bench              [.] stg_thawArrayzh
      6.56%            bench  /lib/libc-2.11.1.so  [.] __GI_memset
      5.27%            bench  ./bench              [.] allocate
      4.34%            bench  ./bench              [.] s224_info
      2.02%            bench  ./bench              [.] s24C_info
      1.17%            bench  ./bench              [.] memcpy@plt
      1.05%            bench  ./bench              [.] memset@plt
      1.02%            bench  ./bench              [.] clearNurseries
      0.27%            bench  [kernel]             [k] sigprocmask
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4928#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to