Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1
  • 2

THEMA:

Loop time and renderer:renderPolyline with points widely outside the screen size 17 Okt 2021 18:49 #1

  • borisff
  • borisffs Avatar Autor
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Beiträge: 61
  • Dank erhalten: 3
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.

Dateianhang:

Dateiname: looptime.lua
Dateigröße:2 KB
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von borisff.

Loop time and renderer:renderPolyline with points widely outside the screen size 17 Okt 2021 20:04 #2

  • LeonAir
  • LeonAirs Avatar
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Beiträge: 57
  • Dank erhalten: 58
Does lcd.setClipping or renderer:setClipping improve the performance? (fixed some typos btw)

Dateianhang:

Dateiname: looptime.lua
Dateigröße:2 KB

In either case it's an indicator for poor optimization.
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Loop time and renderer:renderPolyline with points widely outside the screen size 18 Okt 2021 14:19 #3

  • borisff
  • borisffs Avatar Autor
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Beiträge: 61
  • Dank erhalten: 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
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von borisff.

Loop time and renderer:renderPolyline with points widely outside the screen size 19 Okt 2021 04:57 #4

  • davidmcq137
  • davidmcq137s Avatar
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Beiträge: 75
  • Dank erhalten: 80
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?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Loop time and renderer:renderPolyline with points widely outside the screen size 19 Okt 2021 13:58 #5

  • Raf
  • Rafs Avatar
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Beiträge: 133
  • Dank erhalten: 179
When you set clipping, the X/Y coordinates will be relative to the clipped window/rectangle.
Voltario T30, Touch Switch, MicroVario, AMS, SE6

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Loop time and renderer:renderPolyline with points widely outside the screen size 19 Okt 2021 14:47 #6

  • davidmcq137
  • davidmcq137s Avatar
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Beiträge: 75
  • Dank erhalten: 80
Ah! So the bug is me, not Jeti .. nice :-)

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Seite:
  • 1
  • 2
Ladezeit der Seite: 0.243 Sekunden
Powered by Kunena Forum