diff --git a/process/new.txt b/process/new.txt new file mode 100644 index 0000000..2695a0a --- /dev/null +++ b/process/new.txt @@ -0,0 +1,65 @@ +goos: linux +goarch: arm64 +pkg: github.com/shirou/gopsutil/v3/process +Benchmark_fillFromCommWithContext-80 117801 9645 ns/op +Benchmark_fillFromCommWithContext-80 128160 9557 ns/op +Benchmark_fillFromCommWithContext-80 124488 9570 ns/op +Benchmark_fillFromCommWithContext-80 126180 9488 ns/op +Benchmark_fillFromCommWithContext-80 113413 9889 ns/op +Benchmark_fillFromCommWithContext-80 120090 9650 ns/op +Benchmark_fillFromCommWithContext-80 121117 10132 ns/op +Benchmark_fillFromCommWithContext-80 109662 9708 ns/op +Benchmark_fillFromCommWithContext-80 124315 9951 ns/op +Benchmark_fillFromCommWithContext-80 114738 9754 ns/op +Benchmark_fillFromStatusWithContext-80 42361 25613 ns/op +Benchmark_fillFromStatusWithContext-80 45180 26140 ns/op +Benchmark_fillFromStatusWithContext-80 42746 25890 ns/op +Benchmark_fillFromStatusWithContext-80 44743 24767 ns/op +Benchmark_fillFromStatusWithContext-80 47257 26215 ns/op +Benchmark_fillFromStatusWithContext-80 48838 26133 ns/op +Benchmark_fillFromStatusWithContext-80 47120 26333 ns/op +Benchmark_fillFromStatusWithContext-80 44583 26602 ns/op +Benchmark_fillFromStatusWithContext-80 53058 25234 ns/op +Benchmark_fillFromStatusWithContext-80 43609 24786 ns/op +BenchmarkNewProcess-80 9540 125766 ns/op +BenchmarkNewProcess-80 9381 130526 ns/op +BenchmarkNewProcess-80 8694 130677 ns/op +BenchmarkNewProcess-80 10000 126691 ns/op +BenchmarkNewProcess-80 9465 123453 ns/op +BenchmarkNewProcess-80 9014 129650 ns/op +BenchmarkNewProcess-80 9685 127454 ns/op +BenchmarkNewProcess-80 9266 132037 ns/op +BenchmarkNewProcess-80 9447 126732 ns/op +BenchmarkNewProcess-80 9324 128946 ns/op +BenchmarkProcessName-80 405714842 2.906 ns/op +BenchmarkProcessName-80 414845893 2.906 ns/op +BenchmarkProcessName-80 405879571 2.903 ns/op +BenchmarkProcessName-80 405576182 2.902 ns/op +BenchmarkProcessName-80 406102254 2.929 ns/op +BenchmarkProcessName-80 405528814 2.917 ns/op +BenchmarkProcessName-80 406795386 2.904 ns/op +BenchmarkProcessName-80 405236899 2.903 ns/op +BenchmarkProcessName-80 407348631 2.904 ns/op +BenchmarkProcessName-80 406594641 2.900 ns/op +BenchmarkProcessPpid-80 8344 120555 ns/op +BenchmarkProcessPpid-80 10236 120711 ns/op +BenchmarkProcessPpid-80 10000 119398 ns/op +BenchmarkProcessPpid-80 10318 118461 ns/op +BenchmarkProcessPpid-80 10435 116859 ns/op +BenchmarkProcessPpid-80 10386 123064 ns/op +BenchmarkProcessPpid-80 10291 117243 ns/op +BenchmarkProcessPpid-80 10238 119114 ns/op +BenchmarkProcessPpid-80 10484 118057 ns/op +BenchmarkProcessPpid-80 10135 117615 ns/op +BenchmarkProcesses-80 5 218228353 ns/op +BenchmarkProcesses-80 5 215826386 ns/op +BenchmarkProcesses-80 5 219362359 ns/op +BenchmarkProcesses-80 5 215391927 ns/op +BenchmarkProcesses-80 5 209502339 ns/op +BenchmarkProcesses-80 5 217973671 ns/op +BenchmarkProcesses-80 5 211982866 ns/op +BenchmarkProcesses-80 6 207617137 ns/op +BenchmarkProcesses-80 5 217065433 ns/op +BenchmarkProcesses-80 5 211256014 ns/op +PASS +ok github.com/shirou/gopsutil/v3/process 101.689s diff --git a/process/old.txt b/process/old.txt new file mode 100644 index 0000000..0f6d4fe --- /dev/null +++ b/process/old.txt @@ -0,0 +1,65 @@ +goos: linux +goarch: arm64 +pkg: github.com/shirou/gopsutil/v3/process +Benchmark_fillFromCommWithContext-80 119751 9204 ns/op +Benchmark_fillFromCommWithContext-80 124860 9442 ns/op +Benchmark_fillFromCommWithContext-80 130927 9197 ns/op +Benchmark_fillFromCommWithContext-80 118206 9708 ns/op +Benchmark_fillFromCommWithContext-80 116026 9653 ns/op +Benchmark_fillFromCommWithContext-80 129135 9085 ns/op +Benchmark_fillFromCommWithContext-80 119784 9883 ns/op +Benchmark_fillFromCommWithContext-80 125440 9648 ns/op +Benchmark_fillFromCommWithContext-80 124136 9535 ns/op +Benchmark_fillFromCommWithContext-80 123098 9556 ns/op +Benchmark_fillFromStatusWithContext-80 43220 25280 ns/op +Benchmark_fillFromStatusWithContext-80 50610 25287 ns/op +Benchmark_fillFromStatusWithContext-80 48500 24915 ns/op +Benchmark_fillFromStatusWithContext-80 47887 25965 ns/op +Benchmark_fillFromStatusWithContext-80 46794 24535 ns/op +Benchmark_fillFromStatusWithContext-80 44284 24318 ns/op +Benchmark_fillFromStatusWithContext-80 52395 25844 ns/op +Benchmark_fillFromStatusWithContext-80 48452 25524 ns/op +Benchmark_fillFromStatusWithContext-80 47455 26497 ns/op +Benchmark_fillFromStatusWithContext-80 54568 26063 ns/op +BenchmarkNewProcess-80 8568 139806 ns/op +BenchmarkNewProcess-80 8533 140902 ns/op +BenchmarkNewProcess-80 8624 138080 ns/op +BenchmarkNewProcess-80 9368 138218 ns/op +BenchmarkNewProcess-80 8607 133557 ns/op +BenchmarkNewProcess-80 8623 137908 ns/op +BenchmarkNewProcess-80 8538 145054 ns/op +BenchmarkNewProcess-80 8443 147078 ns/op +BenchmarkNewProcess-80 7162 141291 ns/op +BenchmarkNewProcess-80 7294 145403 ns/op +BenchmarkProcessName-80 381517957 3.099 ns/op +BenchmarkProcessName-80 381213841 3.099 ns/op +BenchmarkProcessName-80 382578319 3.101 ns/op +BenchmarkProcessName-80 382308120 3.096 ns/op +BenchmarkProcessName-80 381155623 3.118 ns/op +BenchmarkProcessName-80 382158510 3.099 ns/op +BenchmarkProcessName-80 381464982 3.098 ns/op +BenchmarkProcessName-80 381580702 3.101 ns/op +BenchmarkProcessName-80 381748222 3.098 ns/op +BenchmarkProcessName-80 381223675 3.096 ns/op +BenchmarkProcessPpid-80 9006 132538 ns/op +BenchmarkProcessPpid-80 7534 134648 ns/op +BenchmarkProcessPpid-80 9085 128758 ns/op +BenchmarkProcessPpid-80 9062 133006 ns/op +BenchmarkProcessPpid-80 8802 127635 ns/op +BenchmarkProcessPpid-80 9714 129837 ns/op +BenchmarkProcessPpid-80 9093 132282 ns/op +BenchmarkProcessPpid-80 8434 124920 ns/op +BenchmarkProcessPpid-80 9072 128690 ns/op +BenchmarkProcessPpid-80 9181 133940 ns/op +BenchmarkProcesses-80 5 249461092 ns/op +BenchmarkProcesses-80 4 257841237 ns/op +BenchmarkProcesses-80 4 256107246 ns/op +BenchmarkProcesses-80 4 256276757 ns/op +BenchmarkProcesses-80 4 255431972 ns/op +BenchmarkProcesses-80 5 261030906 ns/op +BenchmarkProcesses-80 5 259028838 ns/op +BenchmarkProcesses-80 4 255359492 ns/op +BenchmarkProcesses-80 4 251292727 ns/op +BenchmarkProcesses-80 5 251119366 ns/op +PASS +ok github.com/shirou/gopsutil/v3/process 103.759s diff --git a/test_results.txt b/test_results.txt new file mode 100644 index 0000000..99a4a97 --- /dev/null +++ b/test_results.txt @@ -0,0 +1,33 @@ +Before: +goos: linux +goarch: arm64 +pkg: github.com/shirou/gopsutil/v3/process +BenchmarkProcesses +BenchmarkProcesses-80 4 252089573 ns/op +PASS + +Process finished with the exit code 0 + +After: +goos: linux +goarch: arm64 +pkg: github.com/shirou/gopsutil/v3/process +BenchmarkProcesses +BenchmarkProcesses-80 6 203633386 ns/op +PASS + +Process finished with the exit code 0 + + +goos: linux +goarch: arm64 +pkg: github.com/shirou/gopsutil/v3/process + │ old.txt │ new.txt │ + │ sec/op │ sec/op vs base │ +_fillFromCommWithContext-80 9.546µ ± 4% 9.679µ ± 3% +1.40% (p=0.045 n=10) +_fillFromStatusWithContext-80 25.41µ ± 3% 26.01µ ± 5% ~ (p=0.247 n=10) +NewProcess-80 140.4µ ± 4% 128.2µ ± 2% -8.66% (p=0.000 n=10) +ProcessName-80 3.099n ± 0% 2.904n ± 0% -6.29% (p=0.000 n=10) +ProcessPpid-80 131.1µ ± 3% 118.8µ ± 2% -9.36% (p=0.000 n=10) +Processes-80 255.8m ± 2% 215.6m ± 3% -15.70% (p=0.000 n=10) +geomean 39.03µ 36.59µ -6.25%