lilydjwg / swapview-rosetta

Print swap usage per process. Implemented in various programming languages
491 stars 108 forks source link

Haskell{,_parallel}: use bytestring instead of text #169

Closed ksqsf closed 2 years ago

ksqsf commented 2 years ago

Straightforward drop-in replacement of text by bytestring. ByteString is a little faster, because it does not incur overheads of encoding and decoding.

Use text:

---------Results--------(Diff):  KMinAvg      Min      Avg      Max    Stdev  Cnt
Rust_parallel           (100%):    23.33    22.77    23.98    29.11     1.36   20
C                       (100%):    46.44    46.04    46.78    48.56     0.54   20
LuaJIT                  (100%):   108.30   107.73   109.82   114.46     1.94   20
Haskell_parallel        (100%):   134.39   126.31   138.96   156.84     7.89   20
Haskell                 (100%):   147.67   146.85   149.76   161.36     3.37   20

Use bytestring:

---------Results--------(Diff):  KMinAvg      Min      Avg      Max    Stdev  Cnt
Rust_parallel           (100%):    24.24    23.34    24.90    27.14     0.95   20
C                       (100%):    46.48    45.76    47.48    51.63     1.46   20
Haskell_parallel        (100%):    83.91    83.79    84.53    94.23     2.29   20
Haskell                 (100%):    87.69    87.09    88.90    92.21     1.60   20
LuaJIT                  (100%):   107.43   106.49   109.57   115.18     2.79   20