Loop time and renderer:renderPolyline with points widely outside the screen size
- borisff
- Offline Autor
- Senior Mitglied
- Beiträge: 61
- Dank erhalten: 3
Loop time and renderer:renderPolyline with points widely outside the screen size wurde erstellt von borisff
Posted 17 Okt. 2021 18:49 #1
LUA addPoint isn't protected against points widely outside the screen, so
the time between the loop calls can be very high on a real transmitter when using
renderer:renderPolyline.
Attached example
when run on emulator, loop time is 21ms
when run on DC-24, Loop time stabilizes near 660ms.
the time between the loop calls can be very high on a real transmitter when using
renderer:renderPolyline.
Attached example
when run on emulator, loop time is 21ms
when run on DC-24, Loop time stabilizes near 660ms.
Last Edit:17 Okt. 2021 18:50
von borisff
Letzte Änderung: 17 Okt. 2021 18:50 von borisff.
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- LeonAir
- Offline
- Senior Mitglied
- Beiträge: 57
- Dank erhalten: 58
LeonAir antwortete auf Loop time and renderer:renderPolyline with points widely outside the screen size
Posted 17 Okt. 2021 20:04 #2
Does lcd.setClipping or renderer:setClipping improve the performance? (fixed some typos btw)
In either case it's an indicator for poor optimization.
In either case it's an indicator for poor optimization.
von LeonAir
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- borisff
- Offline Autor
- Senior Mitglied
- Beiträge: 61
- Dank erhalten: 3
borisff antwortete auf Loop time and renderer:renderPolyline with points widely outside the screen size
Posted 18 Okt. 2021 14:19 #3
The version with lcd.setClipping and ren::setClipping gives on DC-24 850ms (!) loop time in it's .lc form. Doing the setClipping in the tprint once at first run, same behavior.
When using a more reasonable out of screen addPoint(310 * 2, 160 * 2) delay is 20ms with the setClipping.
I found the bug giving very wide y values in my real app on a particular case using a function checkPoint(x, y) called before any addPoint(x,y)
local function checkPoint(x, y)
if (x < 0 or x > app.width) then
print(lFormat(app.Name .. " Bad x=%d",x))
end
if (y < 0 or y > app.height) then
print(lFormat(app.Name .. " Bad y=%d",y))
end
end
l
When using a more reasonable out of screen addPoint(310 * 2, 160 * 2) delay is 20ms with the setClipping.
I found the bug giving very wide y values in my real app on a particular case using a function checkPoint(x, y) called before any addPoint(x,y)
local function checkPoint(x, y)
if (x < 0 or x > app.width) then
print(lFormat(app.Name .. " Bad x=%d",x))
end
if (y < 0 or y > app.height) then
print(lFormat(app.Name .. " Bad y=%d",y))
end
end
l
Last Edit:18 Okt. 2021 14:29
von borisff
Letzte Änderung: 18 Okt. 2021 14:29 von borisff.
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- davidmcq137
- Offline
- Senior Mitglied
- Beiträge: 75
- Dank erhalten: 82
davidmcq137 antwortete auf Loop time and renderer:renderPolyline with points widely outside the screen size
Posted 19 Okt. 2021 04:57 #4
I have seen the same thing and done the same defense. Have you also noticed that when setting a small clip window on the screen it moves it over by the size of the clip window from the place you specified?
von davidmcq137
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Raf
- Offline
- Premium Mitglied
- Beiträge: 139
- Dank erhalten: 187
Raf antwortete auf Loop time and renderer:renderPolyline with points widely outside the screen size
Posted 19 Okt. 2021 13:58 #5
When you set clipping, the X/Y coordinates will be relative to the clipped window/rectangle.
Voltario T30, Touch Switch, MicroVario, AMS, SE6
von Raf
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- davidmcq137
- Offline
- Senior Mitglied
- Beiträge: 75
- Dank erhalten: 82
davidmcq137 antwortete auf Loop time and renderer:renderPolyline with points widely outside the screen size
Posted 19 Okt. 2021 14:47 #6
Ah! So the bug is me, not Jeti .. nice
von davidmcq137
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Ladezeit der Seite: 1.110 Sekunden