Hideous performance using Azure mobile services MobileServiceSyncTable

不羁的心 提交于 2019-12-13 02:32:48

问题


I have a mobile service sync table that is giving me absolutely HORRENDOUS performance. The table is declared as:

IMobileServiceSyncTable<Myclass> myclassTable;

this.client = new MobileServiceClient("my url here");

var store = new MobileServiceSQLiteStore(“localdb.db”);
store.DefineTable<Myclass>();
this.client.SyncContext.InitializeAsync(store);

this.myclassTable = client.GetSyncTable<Myclass>();

Than later in a button handler I’m calling into:

this.myclassTable.ToCollectionAsync();

The problem is, the performance is horrific. It takes at best minutes and most times just sits there indefinitely.

Is there anything in the above that I’ve done that would explain why performance is so absolutely terrible?


回答1:


this.myclassTable.ToCollectionAsync();

For IMobileServiceSyncTable table, the above method would execute the SELECT * FROM [Myclass] sql statement against your local sqlite db.

The problem is, the performance is horrific. It takes at best minutes and most times just sits there indefinitely.

AFAIK, when working with offline sync, we may invoke the pull operation for retrieving a subset of the server data, then insert the retrieved data into the local store table. For await this.myclassTable.PullAsync(), it would send request and retrieve the server data with the MaxPageSize in 50, and the client SDK would send another request to confirm whether there has more data and pull them automatically.

In summary, I would recommend you checking with your code to locate the specific code which causes this poor performance. Also, you could leverage adding diagnostic logging, capturing the network traces via Fiddler to troubleshoot with this issue.



来源:https://stackoverflow.com/questions/44851902/hideous-performance-using-azure-mobile-services-mobileservicesynctable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!