Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[process][posix] Fix #1049 check if procfs is mounted before checking if pid exists there #1051

Merged
merged 1 commit into from Mar 21, 2021

Commits on Mar 18, 2021

  1. [process][posix] Fix shirou#1049 check if procfs is mounted before ch…

    …ecking if pid exists there
    
    Benchmark before this change (process.NewProcess() calls process.PidExistsWithContext()
    internally)
    
        go test -bench=BenchmarkNewProcess github.com/shirou/gopsutil/process
        goos: linux
        goarch: amd64
        pkg: github.com/shirou/gopsutil/process
        BenchmarkNewProcess-4              14722             78751 ns/op
        PASS
        ok      github.com/shirou/gopsutil/process      3.685s
    
    Benchmark with this change applied
    
        go test -bench=BenchmarkNewProcess github.com/shirou/gopsutil/process
        goos: linux
        goarch: amd64
        pkg: github.com/shirou/gopsutil/process
        BenchmarkNewProcess-4              14835             80180 ns/op
        PASS
        ok      github.com/shirou/gopsutil/process      3.761s
    Lomanic committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    0881c11 View commit details
    Browse the repository at this point in the history