Tfidf update 2: Term frequencies for any term in all documents can now be calculated. In 5 seconds.
IDF shouldn't be much different to do.
Don't know how you're going to check if they're right...