ev3dev-lang-python: python3 is very slow to start

Does it take forever to start a python3 program on an ev3 for anyone else? It takes more than 30s for me to start any program for controlling a robot. Even hello world is taking 6+ seconds.

robot@ev3dev[~]# cat hello_world.py 
#!/usr/bin/env python3

print("hello world")
robot@ev3dev[~]# 
robot@ev3dev[~]# python3 --version
Python 3.4.2
robot@ev3dev[~]# 
robot@ev3dev[~]# time ./hello_world.py 
hello world

real    0m6.497s
user    0m2.030s
sys 0m0.340s
robot@ev3dev[~]# 

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 33 (14 by maintainers)

Most upvoted comments

The hack is to pre-start a python program and then use the:

compiled_code = compile(code, filename, 'exec')
exec(compiled_code, scope)

to start the program from that process.

Can you elaborate more on how do to do this ?