-
Notifications
You must be signed in to change notification settings - Fork 4
Something is very wrong with PouchDB views when run on JXcore #82
Comments
Test results on desktop using leveldown-mobile and 2000 docs:
Clearly there is something wrong when running PouchDB using SpiderMonkey. Results using memdown and 2000 docs:
That is consistent with what we saw on Android. Interesting thing: on desktop SM with JIT disabled is faster, it takes 15.5s vs 21.2s with JIT enabled. |
Test results on desktop using 2000 docs:
Clearly there is something wrong when running PouchDB using SpiderMonkey. |
What we are seeing right now is that the GC goes bananas when we run views so something went wrong in the GC. We are still investigating. |
Disabling the GC makes the test 5 times faster. That is still 2.5 times slower than V8, but there are some memory allocation related functions that have a very high CPU time usage: Some interesting data regarding the memory usage under V8 and SM:
It looks like the SM's GC is more aggressive compared to V8's GC. |
The Since in our test there isn't a view user defined function, I replaced the code that invokes https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-mapreduce/src/index.js#L520 where
That in turns does a trivial:
The result is that the tests is 20 times faster and completes the query in 1.2s, still slower than V8 (0.5s) but acceptable. |
For now we want to see if it isn't easier to get a mode in PouchDB that lets us run views outside of the sandbox. We have tested and that does fix the perf problem and since it's our view on our database we don't need the sandbox security. |
We use the identical code to run in WebViews and on desktop and perf is fine. But specifically on JXcore on the phone perf collapses. See thaliproject/leveldown-mobile#4 for details.
@enricogior Please run the tests with spidermonkey with JIT on desktop just to see if the issue is specific to PouchDB on SpiderMonkey.
The text was updated successfully, but these errors were encountered: