is macOS reducing priority of BTT while not in use
if dont use BTT for a 3-5 min SWM opens slowly but on second launch it almost opens instantly. Same for Enhanced dock preset that uses real javascript
is there a way to bypass or improve this
or BTT deletes cached / compiled versions of scripts over time
I haven't observed this on my machine, but it is possible. Especially if memory gets low macOS will clean up any resources it can. My dev machine has 64GB of RAM, which is probably enough to prevent this from happening.
Could you check via activity monitor what the memory usage is like on your machine when this happens?
I monitored activity monitor with some experiments
there is some tools on windows os for monitoring whats in RAM but i coulnt find one on macOS
My macbook has 16gb ram and 10gb in use in average. using ventura
BTT uses 122mb of memory. 14MB is compressed
1-Opened many applications to increase RAM usage
• Ram usage increased to 11,5 gb. there is still has good amount RAM available but macOS preferred to delete some cache
• Cached files reduced 5.5gb to 4.5gb. it directly efected launching BTT scripts for first lauch so macOS deleted them from cache
• Ofc i dont use this amount of applications at same time
• after closing most of apps ram usage reduced to 9GB. BTT scripts still in cache
2-Opened only 2 heavy applications to increase RAM usage
• RAM usage jumped 9 to 11
• macOS didnt delete BTT cache
3-Didnt touch anything and went to dinner
• BTT cache cleared by macOS again but there is 6GB empty RAM. just weird
Console app shows many about BTT but i dont know which one to look
I guess you can replicate these with creating a 48GB ramdisk on your machine if you dont have a machine with 16 or less gb memory
Conclutions
• im not sure but maybe macOS puts whole BTT to idle mode instead of deleting spesific cache because all script works as normal speed after using one of them. not just used one
• macOS reduces cached files while launching heavy apps even if enough space in RAM and BTT has no priority on cache
Maybe these could be solution
• increasing idle wakes of BTT tells macOS to BTT process is frequently used. so system keeps it in cache. Idle wakes of BTT is very low compared to other processes. maybe there is a trick for this without creating pressure on CPU
• adding "always keep in cache" option for webview, real javascript and javascript actions to force macOS to keep them in cache. Ofc i'm not sure is this possible