Skip to content

Slow EV3 screen update in EV3 Python v2 #526

Closed

Description

@ndward

ev3dev version: 4.14.61-ev3dev-2.2.2-ev3
ev3dev-lang-python version:
ii python3-ev3dev 1.2.0 all Python language bindings for ev3dev
ii python3-ev3dev2 2.0.0~beta1 all Python language bindings for ev3dev

This script seems to show that it takes more than 3s for the screen to update in EV3 Python v2:

#!/usr/bin/env python3
# v2
from ev3dev2.display import Display
from sys import stderr
from time import sleep, time

screen = Display()

start_time = time()
for i in range(10):
    screen.update()
    print(time()-start_time, file=stderr)

Result:
3.3111462593078613
6.4367356300354
9.531918287277222
12.596878051757812
15.702414512634277
18.824042558670044
21.96616840362549
25.0904278755188
28.212737321853638
31.273113012313843
Average update time 3.13s assuming other code takes insignificant time.

The Python 1 script below gives average update time of 0.73s, or more than four times faster than for v2:

#!/usr/bin/env python3
# v1
from ev3dev.ev3 import *
from sys import stderr
from time import sleep, time

screen = Screen()

start_time = time()
for i in range(10):
    screen.update()
    print(time()-start_time, file=stderr)

Times:
0.7801563739776611
1.5146124362945557
2.2300970554351807
2.974599599838257
3.658750534057617
4.398235082626343
5.121510028839111
5.818562984466553
6.541661977767944
7.269548177719116

Something wrong in the new version?

Activity

  1. WasabiFan commented on Sep 19, 2018

    @WasabiFan
    Member

    We have implemented a fix which will be available with the next release. #497

  2. WasabiFan commented on Sep 24, 2018

    @WasabiFan
    Member

    Fix released in 2.0.0~beta2. To upgrade:

    sudo apt-get update
    sudo apt-get install --only-upgrade python3-ev3dev2
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions