With MediaWiki API, you can retrieve 50 pages per request, it should make things much smoother.
(Choose &format= as appropriate)
http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop...
Oh, wonderful. I don't know this. I think this will increase the speed of my script. So the CPU usage will be only a short time. I will try this.
Many thanks to Kalan and all the other.
Stefan