{"action":"created","issue":{"url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/675","repository_url":"https://api.github.com/repos/RPi-Distro/python-gpiozero","labels_url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/675/labels{/name}","comments_url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/675/comments","events_url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/675/events","html_url":"https://github.com/RPi-Distro/python-gpiozero/issues/675","id":362048114,"node_id":"MDU6SXNzdWUzNjIwNDgxMTQ=","number":675,"title":"Performance issues with pkg_resources","user":{"login":"BuddhaOhneHals","id":527043,"node_id":"MDQ6VXNlcjUyNzA0Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/527043?v=4","gravatar_id":"","url":"https://api.github.com/users/BuddhaOhneHals","html_url":"https://github.com/BuddhaOhneHals","followers_url":"https://api.github.com/users/BuddhaOhneHals/followers","following_url":"https://api.github.com/users/BuddhaOhneHals/following{/other_user}","gists_url":"https://api.github.com/users/BuddhaOhneHals/gists{/gist_id}","starred_url":"https://api.github.com/users/BuddhaOhneHals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BuddhaOhneHals/subscriptions","organizations_url":"https://api.github.com/users/BuddhaOhneHals/orgs","repos_url":"https://api.github.com/users/BuddhaOhneHals/repos","events_url":"https://api.github.com/users/BuddhaOhneHals/events{/privacy}","received_events_url":"https://api.github.com/users/BuddhaOhneHals/received_events","type":"User","site_admin":false},"labels":[{"id":260092526,"node_id":"MDU6TGFiZWwyNjAwOTI1MjY=","url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-09-20T07:13:32Z","updated_at":"2018-09-24T13:34:27Z","closed_at":null,"author_association":"NONE","body":"I want to use your library in one of my projects with a Raspberry Pi Zero. Until now I used RPi.GPIO but your API seems just great. But one issue that bothers me is the duration when I'm importing the gpiozero module.\r\nI use a freshly installed raspbian lite (`2018-06-27-raspbian-stretch-lite`) with the gpiozero package installed via `apt`. The import of gpiozero in the python shell needs 5 seconds or more.\r\n```\r\n$ python -c \"from timeit import default_timer as t;s=t();import gpiozero;print(t()-s)\"\r\n5.40878105164\r\n```\r\nIt seems like the import of the `pkg_resources` package in the `devices.py` file is responsible for this:\r\n```\r\n$ python -c \"from timeit import default_timer as t;s=t();import pkg_resources;print(t()-s)\"\r\n4.59635186195\r\n```\r\nIt would be really great and helpful if there's a possibility to skip the importing of the `pkg_resources` package.\r\n"},"comment":{"url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/comments/423976085","html_url":"https://github.com/RPi-Distro/python-gpiozero/issues/675#issuecomment-423976085","issue_url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/675","id":423976085,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzk3NjA4NQ==","user":{"login":"BuddhaOhneHals","id":527043,"node_id":"MDQ6VXNlcjUyNzA0Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/527043?v=4","gravatar_id":"","url":"https://api.github.com/users/BuddhaOhneHals","html_url":"https://github.com/BuddhaOhneHals","followers_url":"https://api.github.com/users/BuddhaOhneHals/followers","following_url":"https://api.github.com/users/BuddhaOhneHals/following{/other_user}","gists_url":"https://api.github.com/users/BuddhaOhneHals/gists{/gist_id}","starred_url":"https://api.github.com/users/BuddhaOhneHals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BuddhaOhneHals/subscriptions","organizations_url":"https://api.github.com/users/BuddhaOhneHals/orgs","repos_url":"https://api.github.com/users/BuddhaOhneHals/repos","events_url":"https://api.github.com/users/BuddhaOhneHals/events{/privacy}","received_events_url":"https://api.github.com/users/BuddhaOhneHals/received_events","type":"User","site_admin":false},"created_at":"2018-09-24T13:34:27Z","updated_at":"2018-09-24T13:34:27Z","author_association":"NONE","body":"Thank you for your detailed answer and your thoughts about the possible solutions.\r\n\r\nI start with the use-case: I built a small jukebox for my daughter using a Pi Zero and some input and output devices for interaction. I put a lot of effort into decreasing the startup duration (using buildroot for example). My daughter would accept 4 or 5 seconds more (perhaps), but I wouldn't  ;)\r\n\r\nAt the moment I use RPi.GPIO, but I want to improve the scripts and GPIO Zero would be really handy (and the API is beautiful, btw.).\r\n\r\nI understand your caution in changing the behavior of the importing mechanism and that you are trying to minimize the complexity. I will use my fork as long as I'm the only one bothered by this.\r\n\r\nSo, thank you again looking into this!\r\n\r\nBtw: I didn't blame anybody for anything :D"}}
{"actor":{"display_login":"BuddhaOhneHals"}}