Bug 410945 - KProcessList::processInfo(qint64 pid) iterates through all processes only to filter them
Summary: KProcessList::processInfo(qint64 pid) iterates through all processes only to ...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kcoreaddons
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Hallas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-15 15:52 UTC by David Edmundson
Modified: 2019-12-15 06:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Edmundson 2019-08-15 15:52:27 UTC
This is unnecessarily slow when we already know which PID we want.
Comment 1 David Edmundson 2019-08-15 15:52:57 UTC
CC'ing original David who wrote it
Comment 2 David Hallas 2019-08-16 16:11:26 UTC
Yeah I see :) I am working on a fix
Comment 3 David Hallas 2019-08-16 16:29:31 UTC
I forget to mention this bugreport in the patch commit message :/

https://phabricator.kde.org/D23205
Comment 4 David Hallas 2019-12-15 06:53:22 UTC
Git commit e16dda4d50bf9e51f1ec1f388f1267bda1c89417 by David Hallas.
Committed on 15/12/2019 at 06:53.
Pushed by hallas into branch 'master'.

[KProcessList] Optimize KProcessList::processInfo

Summary:
Optimize KProcessList::processInfo on unix so that it doesn't iterate over all
processes and then filter the list to the requested process. Instead refactor
the code that fetches process info from a single process and use that function.

Test Plan:
Unit Test

Reviewers: davidedmundson, broulik, mpyne

Reviewed By: mpyne

Subscribers: mpyne, apol, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23205

M  +0    -15   src/lib/util/kprocesslist.cpp
M  +64   -51   src/lib/util/kprocesslist_unix.cpp
M  +15   -0    src/lib/util/kprocesslist_win.cpp

https://commits.kde.org/kcoreaddons/e16dda4d50bf9e51f1ec1f388f1267bda1c89417