Skip to content

Instantly share code, notes, and snippets.

@matonix
Created May 10, 2020 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matonix/110f282bb3f9c80ef9b61da141509157 to your computer and use it in GitHub Desktop.
Save matonix/110f282bb3f9c80ef9b61da141509157 to your computer and use it in GitHub Desktop.

並行並列Haskell 4節 Floyd-Warshall アルゴリズム実行ログ

直列版

$ cabal exec fwsparse -- 1000 800 +RTS -s -N1 -l
552434
   5,700,238,648 bytes allocated in the heap
     188,155,200 bytes copied during GC
         521,336 bytes maximum residency (107 sample(s))
          29,120 bytes maximum slop
               0 MB total memory in use (0 MB lost due to fragmentation)

                                     Tot time (elapsed)  Avg pause  Max pause
  Gen  0      5331 colls,     0 par    0.121s   0.121s     0.0000s    0.0001s
  Gen  1       107 colls,     0 par    0.020s   0.020s     0.0002s    0.0003s

  TASKS: 4 (1 bound, 3 peak workers (3 total), using -N1)

  SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)

  INIT    time    0.000s  (  0.000s elapsed)
  MUT     time   11.593s  ( 11.597s elapsed)
  GC      time    0.141s  (  0.141s elapsed)
  EXIT    time    0.000s  (  0.003s elapsed)
  Total   time   11.735s  ( 11.740s elapsed)

  Alloc rate    491,680,353 bytes per MUT second

  Productivity  98.8% of total user, 98.8% of total elapsed

並列版

$ cabal exec fwsparse1 -- 1000 800 +RTS -s -N1 -l
552434
     761,285,232 bytes allocated in the heap
     141,130,752 bytes copied during GC
         498,320 bytes maximum residency (10 sample(s))
          32,536 bytes maximum slop
               0 MB total memory in use (0 MB lost due to fragmentation)

                                     Tot time (elapsed)  Avg pause  Max pause
  Gen  0       702 colls,     0 par    0.094s   0.094s     0.0001s    0.0003s
  Gen  1        10 colls,     0 par    0.002s   0.002s     0.0002s    0.0003s

  TASKS: 4 (1 bound, 3 peak workers (3 total), using -N1)

  SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)

  INIT    time    0.000s  (  0.000s elapsed)
  MUT     time    4.769s  (  4.798s elapsed)
  GC      time    0.096s  (  0.096s elapsed)
  EXIT    time    0.000s  (  0.006s elapsed)
  Total   time    4.865s  (  4.900s elapsed)

  Alloc rate    159,637,469 bytes per MUT second

  Productivity  98.0% of total user, 97.9% of total elapsed

並列版 4コア

$ cabal exec fwsparse1 -- 1000 800 +RTS -s -N4 -l
552434
     861,157,096 bytes allocated in the heap
      80,079,464 bytes copied during GC
         299,056 bytes maximum residency (2 sample(s))
          57,296 bytes maximum slop
               0 MB total memory in use (0 MB lost due to fragmentation)

                                     Tot time (elapsed)  Avg pause  Max pause
  Gen  0       421 colls,   421 par    0.347s   0.042s     0.0001s    0.0003s
  Gen  1         2 colls,     1 par    0.001s   0.000s     0.0001s    0.0001s

  Parallel GC work balance: 32.10% (serial 0%, perfect 100%)

  TASKS: 10 (1 bound, 9 peak workers (9 total), using -N4)

  SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)

  INIT    time    0.002s  (  0.001s elapsed)
  MUT     time    4.938s  (  1.329s elapsed)
  GC      time    0.348s  (  0.042s elapsed)
  EXIT    time    0.001s  (  0.009s elapsed)
  Total   time    5.288s  (  1.381s elapsed)

  Alloc rate    174,404,181 bytes per MUT second

  Productivity  93.4% of total user, 96.2% of total elapsed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment