ltonetwork / mongodb-rest

JSON REST server for MongoDB (using node.js)
MIT License
405 stars 143 forks source link

Collection Cache #16

Closed muddydixon closed 6 years ago

muddydixon commented 13 years ago

In this pull request, I add Collection cache to lib/rest.js. This cache improves response time.

I try benchmark like that,

$ for j in 1 2 3 4 5; do time for i in {1..1000}; do wget -q http://localhost:3000/mydb/mycol/ -O /dev/null ; done; done

= enable cache = real 0m14.848s real 0m14.015s real 0m15.896s real 0m14.367s real 0m15.940s = disable cache = real 0m17.740s real 0m17.694s real 0m17.361s real 0m18.010s real 0m17.511s