Hi there.
First I need to thank for the help with my first hobby ApplescriptObjc project I have received here. I had a very ambitious project given my experience but now I have a very stable and “feature complete” program. Without the help with a few but very important questions I would have been stuck.
But now I hope to streamline it a bit.
What I have is a program that queries a webpage, extract some information, do a lot of manipulation on it and store the results to a file. The program spent most of its time in a repeat block, half of the time inside another nested repeat block. As expected that give me a constant beachball. I dont´mind that for now because the main function of the program is to record information. I will look into adding a stop function so I can exit the program more gracefully later on.
But for some reason it also make Safaris CPU usage go through the ceiling. While the ASOC program itself use @ 15% CPU time, Safari jumps to 80-90% constant usage and the CPU temperature to 90-92 c (on my 2011 MBA). The program needs to run for 30-60 minutes at the time so I would really prefer it not to eat so many CPU cycles and generate so much heat. I have tried to ease up how often the program queries the web page but it doesn´t really seems to make a difference if I let it do it each second, each other second or five times per second.
My question is if there is something I can do to the structure of the program that would let Safari eat less cycles?
In pseudocode the program is as follows: