Closed iloveitaly closed 1 year ago
@ErikBjare I just tried from source. I'll build the app and see it things continue to work.
Question for you: what are your thoughts on increasing poll time to 3s? Polling via applescript takes up a non-trivial amount of CPU time and 1s resolution doesn't get me anything vs 3s (or 10s in my case).
Question for you: what are your thoughts on increasing poll time to 3s? Polling via applescript takes up a non-trivial amount of CPU time and 1s resolution doesn't get me anything vs 3s (or 10s in my case).
The 1s poll time was originally chosen on a whim as we weren't sure how much it would affect the data. Should probably run a testing instance parallel to my prod one and check the actual time diffs with 3s, 10s, etc, but that would be some work.
For now, we keep the 1s, but if we have good data suggesting that 3s makes little difference, we can switch to that (would yield a general performance improvement, as number of events would prob reduce by more than >3x).
@ErikBjare with the new swift-based notifications in place, we won't need this. At some point we should rip out the python-based tracker for macOS as well.
unfortunately, it's well-documented that applescript leaks memory like crazy:
It's not designed to be executed over and over by the same process. In our case, this resulted in massive memory usage over time. To work around this, this forks a process to run our applescript and kill it every so often to clean out it's memory usage.
It's not pretty, but neither is 1GB memory usage for the window watcher. @ErikBjare I'm curious your take on this approach and if I should clean it up for merging.