Closed matmen closed 5 months ago
@pedrolamas Moving the URL instantiation outside of the handleRefresh method was intentional, no point in creating a new object 30 times a second 😉 Maybe removing the cameraImageSource
altogether and replacing it with a url
object is the way to go here?
Moving the URL instantiation outside of the handleRefresh method was intentional, no point in creating a new object 30 times a second 😉
Ah, fair point on that! This type of code has been in for ages, but indeed I see no reason why we shouldn't change it to a more "optimized" approach.
Maybe removing the
cameraImageSource
altogether and replacing it with aurl
object is the way to go here?
I tried it and doesn't work without other changes because the URL instance is always the same so Vue doesn't raise a change notification.
I'll refactor back to 2 properties!
Resolves an error when destroying an adaptive MJPEG camera feed:
Profiling showed this also improves
handleRefresh
performance by ~15% (1.97ms vs 1.67ms).