Even with long polling, the main version is still averaging 5 - 10 seconds before asking for more work, which prevents you from working through the entire getwork.
Are you sure about that ? It should request new getwork only after checking through all the nonce or 60 seconds of work, whatever comes first.
All nonce is checked in ~7 seconds on 5870 GPU.
Line 114 - 115 of BitcoinMiner.py
self.askrate = max(int(askrate), 1)
self.askrate = min(self.askrate, 10)
Yes, we're sure. If you use more than 10 seconds for the askrate, it will force a maximum of 10 seconds. So that great that it's ~ 7 seconds on that card, but not everyone uses the same card, and can take longer than 10 seconds to work through an entire getwork.
Also, poclbm requests a new getwork when the first nonce is found, and doesn't keep working through the rest of the getwork looking for more nonce's. You can find more than 1 nonce in a getwork.
These are just a few changes to our modified version. We thought that checking the miner's local bitcoind would be a viable way to detect when the block changed and request a new getwork, but that's not always the best solution. The reason that it is not the best solution is my local bitcoind may have been notified that the block count changed, but the pool's bitcoind may not have gotten the memo at the same time my local bitcoind did. So a race condition is in effect, and the miner requests a new getwork, then seconds later the pool's bitcoind got the memo and updated it's block count, and the getwork my miner just got becomes stale. But sometime's it's the other way around too.
So long polling seems to be the better solution.