At the moment I am tasked with evaluating Couchbase (Server, Lite and Sync Gateway) for a new project.
I created a test application that simulates our use case. One part of this is to pull a large amount of documents from the server. After the pull is complete a View is created to index all documents (and I execute a query to ensure the index is built).
(Note: I am aware of the recommendation to include a pre-built database in the application package. However, this is not possible for all of our use cases.)
I have implemented a test (open empty database + pull 10k small [~1k] documents + create view/run query) with Android native (Java SDK) and Xamarin. The results are:
With Android native it takes around 45sec to pull the documents and to create the index. With Xamarin it takes 3min 30sec. (creating the view/index is roughly equal but Xamarin takes much longer to pull the documents)
- Running on Android 7.1.2 on an OnePlus 3
- Xamarin Version: current version included in Visual Studio 2017
- Couchbase Lite SDK Java/.NET: 1.4.1
- Server: Couchbase 5.0 + Sync Gateway 1.5.1 (4 core, 16GB memory). No other devices access the server during testing.
- Java implementation uses default SQLite storage engine. On Xamarin I tested SystemSQLite and CustomSQLite.
One difference I noticed is that during pull the Xamarin version produces much more output regarding garbage collection in ADB logcat. (so the performance difference is caused by excessive memory allocation/deallocation?)
Is this performance difference expected?
Do you have any suggestion on how to improve performance on Xamarin?