question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

python3 is very slow to start

See original GitHub issue

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[~]# 

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:33 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
Atzingencommented, Sep 21, 2018

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 ?

0reactions
scprotzcommented, Sep 22, 2019

I wonder if it works on micro python.

On Sep 22, 2019, at 10:12 AM, Brady P. Merkel notifications@github.com wrote:

I’m especially intrigued by @QuriyKort’s single-file ev3fast.py implementation; https://github.com/QuirkyCort/ev3dev-lang-python-fast. See his README for the benchmarks he ran.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Python is so slow and how to speed it up | by Mike Huls
In this article we'll discover that Python is not a bad language that is just very slow. It is optimized for the purpose...
Read more >
Python is very slow to start on Windows 7 - Stack Overflow
The problem is solved by uninstalling Sophos SafeGuard. This is not really a satisfactory solution though since my company uses this ...
Read more >
How to speed up Python application startup time
Generally speaking, when application starts, there are some startup process like loading environment variables or config files.
Read more >
Is Python Really Very Slow ? 2 Major Problems Which Makes ...
Python is a slow programming language because of its dynamically typed feature and single interpreter running with one CPU core during its application....
Read more >
Issue 34296: Speed up python startup by pre-warming the vm
But I think this should become a priority because it's real and tangible, and other people may face the slow startup problem as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found