Answers.Body: <p>Printing text in <code>pybricks-micropython</code> on ev3dev has known performance issues, so we don't recommend doing that in a loop. The trade off is that, unlike ev3-g, you can also print in other languages that don't use Latin scripts like Chinese and Russian. Most other things should run much faster.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-31T17:16:19.197Z
Answers.LastActivityDate: 2020-12-31T17:16:19.197Z
Answers.UserDisplayName: David Lechner
Body: <p>I got MINDSTORMS EV3 for my son and me. We installed Python (ev3dev) and ii seems to be running very slowly. I tried setting up the classic LEGO ev3g (block code), and that seems to run fine.</p>
  <p>Are we doing something wrong or is Python very slow on MINDSTORMS?</p>
  <p>Please help!</p>
  <p>Example:</p>
  <p>Simple program - display count and loop 100 times</p>
  <p>Python: ~1.5s</p>
  <p>ev3g: ~0.15s</p>
  <p>Edit:</p>
  <pre><code>#!/usr/bin/env pybricks-micropython
  
  from pybricks.hubs import EV3Brick
  from pybricks.tools import wait, StopWatch
      
  ev3 = EV3Brick()
  ev3.speaker.beep()
  timer = StopWatch()
      
  for x in range(0, 100):
      ev3.screen.print(str(x) + ':' + str(timer.time()))
    
  wait(5000)
  </code></pre>
  <p>This on the screen the last line displayed is
  99:1113</p>
  <p>this takes just over ~ 1.1s to loop 100 times</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-16T03:46:35.107Z
Comments.Text: Welcome to Bricks.SE.  Can you post the python source code?
Comments.UserDisplayName: chicks
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T20:05:00.153Z
Comments.Text: @chicks sorry for the delay. I have added the code for the python end. nothing fancy. Any idea why it is so slow?
Comments.UserDisplayName: Ishey4
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-30T08:18:23.153Z
Comments.Text: We cannot post our answer at the moment, we are voting to reopen the question so that it can be answered. And this is actually the comments section.
Comments.UserDisplayName: mindstormsboi
Tags: <ev3><mindstorms><ev3dev><pybricks>
Title: Why does Pybricks on ev3dev have slow performance compared to EV3-G?
UserDisplayName: Ishey4
ThreadText: # Why does Pybricks on ev3dev have slow performance compared to EV3-G?
  
  (Asked by: username_0 on 2020-12-15)
  
  I got MINDSTORMS EV3 for my son and me. We installed Python (ev3dev) and ii seems to be running very slowly. I tried setting up the classic LEGO ev3g (block code), and that seems to run fine.
  
  Are we doing something wrong or is Python very slow on MINDSTORMS?
  
  Please help!
  
  Example:
  
  Simple program - display count and loop 100 times
  
  Python: ~1.5s
  
  ev3g: ~0.15s
  
  Edit:
  
  ```
  #!/usr/bin/env pybricks-micropython
  
  from pybricks.hubs import EV3Brick
  from pybricks.tools import wait, StopWatch
      
  ev3 = EV3Brick()
  ev3.speaker.beep()
  timer = StopWatch()
      
  for x in range(0, 100):
      ev3.screen.print(str(x) + ':' + str(timer.time()))
    
  wait(5000)
  
  ```
  
  This on the screen the last line displayed is
  99:1113
  
  this takes just over ~ 1.1s to loop 100 times
  
  **Tags:** ev3, mindstorms, ev3dev, pybricks
  
  > **Comments:**
  > **username_1**: Welcome to Bricks.SE.  Can you post the python source code?  
  > **username_0**: @username_1 sorry for the delay. I have added the code for the python end. nothing fancy. Any idea why it is so slow?  
  > **username_2**: We cannot post our answer at the moment, we are voting to reopen the question so that it can be answered. And this is actually the comments section.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2020-12-31. Score: 2 | Accepted answer
  
  Printing text in `pybricks-micropython` on ev3dev has known performance issues, so we don't recommend doing that in a loop. The trade off is that, unlike ev3-g, you can also print in other languages that don't use Latin scripts like Chinese and Russian. Most other things should run much faster.
  
  
  ---
  
  