pouchdb / pouchdb-server

CouchDB-compatible server built on PouchDB and Node
Apache License 2.0
948 stars 154 forks source link

Profile PouchDB Server, make it faster #203

Open nolanlawson opened 7 years ago

nolanlawson commented 7 years ago

I've done some light perf testing with PouchDB's performance test suite, but I haven't done any heavy-duty performance profiling, and I'm sure there are low-hanging fruit in there. Currently, PouchDB Server seems to be slower than CouchDB in certain scenarios, even when running in in-memory mode (!).

Perf testing is fairly easy; we can just run node --inspect ./packages/node_modules/pouchdb-server/bin/pouchdb-server and then run the test suite against it, and use the Chrome Dev Tools' Profiler to see where time is being spent. My hunch is that most of the slowness is due not to PouchDB's LevelDB adapter (which has been pretty strenuously optimized over the years), but rather to this codebase.

nolanlawson commented 7 years ago

Did some initial analysis using Node 7 and the Pouch test suite, some observations: