使用Azure移动服务MobileServiceSyncTable的出色性能 [英] Hideous performance using Azure mobile services MobileServiceSyncTable

查看:48
本文介绍了使用Azure移动服务MobileServiceSyncTable的出色性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个移动服务同步表,这给我带来了绝对糟糕的性能. 该表声明为:

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?

推荐答案

this.myclassTable.ToCollectionAsync();

this.myclassTable.ToCollectionAsync();

对于IMobileServiceSyncTable表,上述方法将对本地sqlite数据库执行SELECT * FROM [Myclass] sql语句.

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,在使用脱机同步时,我们可能会调用

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.

总而言之,我建议您检查代码以查找导致性能下降的特定代码.另外,您可以利用添加诊断日志记录,通过 Fiddler 捕获网络跟踪,以解决此问题.

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.

这篇关于使用Azure移动服务MobileServiceSyncTable的出色性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆