Open evancohen opened 8 years ago
I created the performance-improvements branch to see what we can do to make it stable.
A few pieces of advice I got from a colleague:
myApp.config(['$compileProvider', function ($compileProvider) { $compileProvider.debugInfoEnabled(false); }]);
to circumvent angular from setting debug info in your html.Might also be a good idea to look into directives to keep the HTML clean. It is usually only used for reusable components, but in a one-page layout project like this it might also have its use.
Performance improvements would be very appreciated.
After I finally finished the frame for my smart-mirror I made a long-term test (over night). As I wanted to talk to the mirror in the next morning it was totally unresponsive. For example it detects the hotword, but before the white shine at the button appears the mirror already stops listening.
Also I have a constant cpu load of 40% (Pi2). I think thats because of the hotword detection.
@7h30n3 believe it or not, the hotword detection/keyword spotting is just about the most efficient thing in the mirror today 😉, for the Pi Zero it uses < 10%. I don't think 40% CPU load on the Pi 2 is all that bad, to be honest. We might be able to optimize some things here, but the optimizations that we can make for the mirror likely won't decrease overall CPU consumption by much, mostly because x
just isn't that optimizable for what we are doing.
Regarding the mirror being unresponsive: uh oh! that's exactly what we don't want happening. This could be because of a memory leak (I've added a task here to investigate it).
It's been a while since I've looked at the mirror's performance. The start-up time is getting pretty bad, and I feel like it no longer feels smooth. I'm going to spend some time investigating the following:
Notes: I don't want to focus too much on boot time, in most cases the mirror boots and then is left running for a long period of time. The bulk of the optimizations that I would like to make here are for lower CPU usage over time and quick responses to commands.
Aforementioned Chart: Generated on a beefy Windows machine using Chromium Profiler in the Dev tools.