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

i3ipc is twice as slow as runnig swaymsg -t get_tree and parsing the json #203

Open
josch opened this issue Dec 17, 2022 · 0 comments
Open
Assignees
Labels

Comments

@josch
Copy link

josch commented Dec 17, 2022

Hi,

the following is tested on Debian unstable with i3ipc 2.2.1:

$ time python3 -c 'import json; import subprocess; data = json.loads(subprocess.check_output(["swaymsg", "-t", "get_tree"]))'

real	0m0.155s
user	0m0.137s
sys	0m0.016s
$ time python3 -c "import i3ipc; i3ipc.Connection().get_tree()"

real	0m0.333s
user	0m0.297s
sys	0m0.033s

I think this is a bug. Spawning a subprocess and parsing its output should not be faster than using a dedicated library to do the job. And it should definitely not be twice as fast as using the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants