lilydjwg / swapview-rosetta

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

D, D_parallel: speed up #166

Closed yshui closed 3 years ago

yshui commented 4 years ago

readln is slow, read whole file then split by line is faster.

D_parallel is as efficient as Rust_parallel in terms of CPU time, but its CPU usage is lower because of allocation locks.

yshui commented 4 years ago

Result on Ryzen 3900X:

           Rust_parallel: top:   42.90, min:   38.87, avg:   44.92, max:   60.62, mdev:    4.19, cnt:  20
         D_parallel_llvm: top:   67.13, min:   60.95, avg:   74.74, max:   89.63, mdev:    9.24, cnt:  20
              D_parallel: top:   74.38, min:   63.93, avg:   81.80, max:   97.74, mdev:    9.40, cnt:  20
                       C: top:  275.04, min:  258.46, avg:  280.82, max:  294.05, mdev:    7.62, cnt:  20
                    Rust: top:  291.71, min:  283.83, avg:  294.79, max:  302.48, mdev:    4.05, cnt:  20
                  D_llvm: top:  308.40, min:  304.42, avg:  311.84, max:  319.61, mdev:    4.13, cnt:  20
                       D: top:  355.53, min:  346.98, avg:  360.08, max:  370.55, mdev:    5.82, cnt:  20
lilydjwg commented 3 years ago

I reverted the "disable GC" commit because it seems to be too specific.