[IronPython] Some observations about parallel import and Silverlight
dan.eloff at gmail.com
Tue Nov 25 15:55:04 PST 2008
Thanks to the excellent work of Kamil
(http://github.com/luntain/ipy-parallel-import/tree/master), and the
help of Jimmy I now have importing being done in parallel in 4 threads
I had to restructure my code a little to reduce circular imports (not
a bad thing to do anyway) and I had to hand-tweak the dependency graph
to deal with conditional imports and other difficult to track
The result was better than I could have hoped for. I'm seeing 43%
faster loading on my dual-core development pc. I used to have blank
screen at start that made you wonder if the browser has frozen. But
now the browser is responsive and I have a nice working progress bar.
But that's not the best news.
The kicker is that the benefit is even larger on slow single core
machines with dialup internet. I posted a while back on this list that
IE does not immediately send an asynchronous request. It waits until
it's UI thread is idle (which doesn't happen if your importing modules
like crazy on it.) So the net effect was the application loads (about
28 seconds on a P4 2ghz) and then it sends the request, waits for the
response (which is big in my case), and processes it - all in order.
So if that takes another 30 seconds, you have nearly 1 minute of load
time. With the UI thread mostly idle now, this happens in parallel to
the importing, and the overall load time drops by a whopping 45%.
In the words of my generation - w00t!
More information about the Users