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

Cygwin blink #5

Open
ctjhoa opened this issue Feb 7, 2015 · 7 comments
Open

Cygwin blink #5

ctjhoa opened this issue Feb 7, 2015 · 7 comments

Comments

@ctjhoa
Copy link
Member

ctjhoa commented Feb 7, 2015

Command to get CPU load on windows is so slow that tmux status bar blink sometimes.

% time ./cpu_percentage.sh
5.0%./cpu_percentage.sh  0.03s user 0.04s system 6% cpu 1.197 total

1.197 seconds against 0.016 with linux command for example.

If a windows expert have better command. I'll be glad.

@Memphizzz
Copy link

I guess thats also causing the CPU usage hickups in task manager then... I had to disable the plugin because of them..

@Memphizzz
Copy link

Memphizzz commented Apr 29, 2016

Maybe you can use this command as it works on cygwin and it looks like its not cpu heavy:

typeperf "\Processor(_Total)% Processor Time"

@ctjhoa
Copy link
Member Author

ctjhoa commented Apr 29, 2016

I will do some benchmark with the command:
typeperf "\Process(*)\% Processor Time" -sc 1
I'll keep you in touch.

@ctjhoa
Copy link
Member Author

ctjhoa commented Apr 30, 2016

So here is the trick.
typeperf use counters to get what you want to retrieve. In our case, there are "Process"/"Processor Time"/"Processor". Those counters are localized by the system language (source).
For example, for me, with my french system I have to type this to get the right result:

ctjhoa@SKYNET ~ % time typeperf "\processeur(_total)\% temps processeur" -sc 1

"(PDH-CSV 4.0)","\\SKYNET\processeur(_total)\% temps processeur"
"04/30/2016 11:26:02.558","20.444041"
Fin du programme, veuillez patienter...
L'opération s'est bien déroulée.
typeperf "\processeur(_total)\% temps processeur" -sc 1  0.00s user 0.01s system 1% cpu 1.141 total

First, the total time is as bad as the WMIC command.
Second, I should limit this feature to english system only. And get system language doesn't seems so easy in windows world (source). Not to mention that retrieve system language take time and cpu.

So typeperf command is not the answer IMO.

Finally, I've done some performance testing of the tmux-cpu's cygwin command:
I don't see any high cpu usage with tmux in the task manager.
capture

I've done some benchmark too with the task manager's graphs. Red zone is when I use tmux.

Screenshot with the WMIC command:
capture-with-tmux-cpu

Screenshot with a dummy number (12):
capture-without_tmux_cpu

So yes, the WMIC consume more cpu but it's reasonable.
My system info:

  • CPU: Intel(R) Core(TM)2 Quad Q9300 @ 2.50Ghz 2.50Ghz
  • RAM: 8Go
  • Windows 7 Pro x64

@ctjhoa
Copy link
Member Author

ctjhoa commented Apr 30, 2016

Maybe you should try to update your tmux package ?

@Memphizzz
Copy link

I'm on tmux v.2.2. Nothing to update there...

@ctjhoa
Copy link
Member Author

ctjhoa commented May 4, 2016

@Memphizzz could you send me screenshot of our task manager (when tmux-cpu is running) and more info about your system please ?

casperdcl added a commit that referenced this issue Jul 9, 2020
- fixes #27
- fixes #15
- fixes #5
casperdcl added a commit that referenced this issue Jul 9, 2020
- fixes #27
- related #15
- related #5
casperdcl added a commit that referenced this issue Jul 9, 2020
- fixes #27
- related #15
- related #5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants