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

Using bash on Emacs, procs-0.12.2 is very slow compared to procs-0.11.13. #291

Closed
HiraokaTakuya opened this issue May 25, 2022 · 2 comments

Comments

@HiraokaTakuya
Copy link

Using bash on Emacs, procs-0.12.2 is very slow compared to procs-0.11.13.
Below is a Dockerfile for testing this phenomenon.

FROM rust:1.61 AS builder

WORKDIR /work
RUN git clone https://github.com/dalance/procs.git && \
    cd procs && \
    git checkout v0.11.13 && \
    cargo build --release && \
    mv target/release/procs /work/procs-0.11.13 && \
    git checkout v0.12.2 && \
    cargo build --release && \
    mv target/release/procs /work/procs-0.12.2

FROM ubuntu:20.04
COPY --from=builder /work/procs-0.11.13 /usr/local/bin/procs-0.11.13
COPY --from=builder /work/procs-0.12.2 /usr/local/bin/procs-0.12.2

ENV TZ=Asia/Tokyo
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /work
RUN apt-get update && \
    apt-get install -y --no-install-recommends emacs && \
    mkdir /root/.emacs.d && \
    echo '(setq inhibit-startup-message t)' > /root/.emacs.d/init.el
  1. docker run this.
  2. emacs -nw
  3. (on Emacs) M-x shell (M-x is Alt + x)
  4. (on Emacs) bash
  5. (on Emacs) time procs-0.11.13 --pager disable
  6. (on Emacs) time procs-0.12.2 --pager disable

This is the result.

# bash
root@4cb6666b3fd2:/work# time procs-0.11.13 --pager disable
�]11;?�\ PID:▲ User │ TTY   CPU MEM CPU Time │ Command
            │       [%] [%]          │
 1     root │ pts/0 0.0 0.0 00:00:00 │ bash
 9     root │ pts/0 0.0 0.2 00:00:00 │ emacs -nw
 11    root │ pts/1 0.0 0.0 00:00:00 │ /bin/sh -i
 12    root │ pts/1 0.0 0.0 00:00:00 │ bash

real	0m0.215s
user	0m0.001s
sys	0m0.016s
root@4cb6666b3fd2:/work# time procs-0.12.2 --pager disable
�]11;?�\ PID:▲ User │ TTY   CPU MEM CPU Time │ Command
            │       [%] [%]          │
 1     root │ pts/0 0.0 0.0 00:00:00 │ bash
 9     root │ pts/0 0.0 0.2 00:00:00 │ emacs -nw
 11    root │ pts/1 0.0 0.0 00:00:00 │ /bin/sh -i
 12    root │ pts/1 0.0 0.0 00:00:00 │ bash

real	0m30.123s
user	0m0.005s
sys	0m0.016s
root@4cb6666b3fd2:/work# 
dalance added a commit that referenced this issue May 25, 2022
@dalance
Copy link
Owner

dalance commented May 25, 2022

Thanks!

This is because emacs doesn't support termnial background color query,
so procs wait until timeout.

I fixed it, and released v0.12.3.

@HiraokaTakuya
Copy link
Author

Thank you for fixing it in an instant!

@dalance dalance closed this as completed Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants