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][windows] Retrieve process name as basename of executable #1369

Merged
merged 2 commits into from Oct 29, 2022

Commits on Oct 22, 2022

  1. Copy the full SHA
    bd4529a View commit details
    Browse the repository at this point in the history
  2. [process][windows] Retrieve process name as basename of executable

    We align ourself with psutil
    https://github.com/giampaolo/psutil/blob/8e4099d9f063ceb4ee3da5845562c5b934f83544/psutil/_pswindows.py#L749-L759
    
    Benchmarks show vast improvements
    
        go test -run=BenchmarkProcessName -bench=BenchmarkProcessName ./process
        goos: windows
        goarch: amd64
        pkg: github.com/shirou/gopsutil/v3/process
        cpu: Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
        BenchmarkProcessName-4               180           6564033 ns/op
        BenchmarkProcessNameViaExe-4       22111             51153 ns/op
        PASS
        ok      github.com/shirou/gopsutil/v3/process   3.914s
    
    Fixes shirou#1368
    Lomanic committed Oct 22, 2022
    Copy the full SHA
    980cc82 View commit details
    Browse the repository at this point in the history