wow, amazing. Thank you @Araq, @ElegantBeef and @cblake. With Nim it feels like I got the keys to a Lamborghini :)
@cblake: You're right, this part of the code is used to generate an inverted index. I then calculate the Jaccard-Index between all pairs of 'docs' to find similar documents for a recommender system. Users of my applications are really feeling the difference after I ported the backend to Nim. Happy holidays to all and thank you again for the amazing work !