![]() |
Progressively longer to initialize Python
So we just came back from an event and I noticed as time went on, the starting of robot code took an increasing amount of time, starting from about 4 seconds at unbag to 15 seconds at bag. It didn't seem to be user code because I have prints at the start and the end of robotInit and it was printing the start message a second or two before the robot code led turns green. I was wondering if anyone else noticed this or has a reasonable explanation for the lag.
Also, kinda related, but halfway through the competition the first deploy stopped working. We had to cancel the first deploy while it was looking for the RIO and restart deploy to get it to work (sometimes multiple times). It wasn't connection or anything because I made sure the drive station showed Robot code led green before deploying but it was no help.. |
Re: Progressively longer to initialize Python
Quote:
Quote:
|
Re: Progressively longer to initialize Python
Quote:
Quote:
|
Re: Progressively longer to initialize Python
Still have issues today? I would be interested in finding out more about it. No issues here.
|
Re: Progressively longer to initialize Python
Heh, I'm afraid that the team will no longer be using Python after last weekend's competition (not my decision). Hopefully (not hopefully?) another team has this same issue and will be able to shed some light on it.
|
Re: Progressively longer to initialize Python
So we switched back to Python and this time it didnt seem to get progressively longer, but it just seemed to take a generally long time. When we were using Java there was maybe 1-2 seconds between the robot code LED turning on and off and with Python there is a good 10 seconds. Any thought?
|
Re: Progressively longer to initialize Python
Quote:
Just did this experiment: Code:
# time python3 -c 'import wpilib' |
Re: Progressively longer to initialize Python
Is it possible to preload these libraries outside of user code? It wouldn't help rio boot up time at all but it would minimize time between deploys
|
Re: Progressively longer to initialize Python
Python does support the reload() builtin, so in theory one could auto-reload code on demand. pyfrc's deploy even has an --inplace option that doesn't delete the existing code, so that the yeti framework can do this sort of thing. Would require some deep magic integration somewhere to make it more general.
Most of the time, the real answer is use ntproperty so that you have easy to use tunables, instead of redeploying code. :) |
Re: Progressively longer to initialize Python
Quote:
If the pyfrc libraries were compiled before being uploaded to the RIO (if they aren't already), would that make it significantly faster? |
Re: Progressively longer to initialize Python
Quote:
Quote:
|
Re: Progressively longer to initialize Python
Quote:
Anecdotally, our robotpy deploy times dropped by at least a couple seconds once we switched our RoboRio to static IP and used that IP (not the hostname) to deploy. I would also second Dustin's advice on using tunables when practical, and just avoid redeploying for every tweak. Although coming from using LabView in previous years our team still finds the robotpy deploy times to be a vast improvement. |
| All times are GMT -5. The time now is 21:37. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi