News7.ex now runs at Ludicrous Speed.
- Posted by useless_ Sep 19, 2012
- 1736 views
News7.ex now runs at Ludicrous Speed.
By running profile on news7 vs news3, the main loop in news7 runs 350 times vs 17 times in news3, so there's lot more time there to insert other tasks, if you like. In http.e, there's time to poll socks.e over 2000 times, in news3 it was under 400 times (while that doesn't help with only 15 urls, let your imagination roam).
I removed the global quit variable, and now use a task to set the quit time. I then didn't schedule main app as a task. With the freed time, i added a task counter to the screen, and you can see how it rather instantly keeps up with the search_url tasks as they complete. I also applied the local task_list() Matt came up with yesterday.
In the http://designerthinking.com/OpenEuphoria/ path you'll also find eui.bat to run instead of eui.exe, this will open the dosbox to full screen immeadiately for you.
You'll want to get http.e too, it has the task_yield patch.
I'd be real interested to hear if this version runs any faster than news.ex or news3.ex for those of you with internet download speeds over 3Megabits.
Ok, people trying to dl the directory.., here's the urls all spelled out:
http://designerthinking.com/OpenEuphoria/news7.ex
http://designerthinking.com/OpenEuphoria/news3.ex
http://designerthinking.com/OpenEuphoria/http.e
http://designerthinking.com/OpenEuphoria/eui.bat
I swear, if you are on dialup, you may not get 15 urls by the time either news3 or news7 times out. In which case, you won't notice any speedup anyhow. Of course, you can increase the value of the timeout in either one too.
If you are on an OC fiber, news7 should blow away news3.
useless