簡體   English   中英

WP SilverLight 8.1 vs WP 8.1(XAML)的優點和缺點

[英]WP SilverLight 8.1 vs WP 8.1 (XAML) pros and cons

我一直在讀Wp8.1(XAML)應用程序是為Windows Phone 8.1創建應用程序的新方法,並且該代碼對Windows 8.1桌面應用程序具有高度可重用性。

但是有點擔心,因為從聯系人(WP8.1 XAML中的ContactManager)執行單個搜索比Silverlight對應的慢。

只需從我的議程中返回所有聯系人(240個聯系人,包括電子郵件,縮略圖等......),我的Lumia 1520需要3秒鍾; 與Silverlight代碼相同的操作需要0.7秒。

我有點害怕使用WP8.1制作手機應用程序,因為性能對我來說非常重要。 使用Lumia 1520的觸點,Lumia 535的相同測試分別需要7秒和1.5秒。

是否有關於使用何種項目的推薦? 我覺得Silverlight應用程序(顯然)專注於Windows Phone並使用所有手機的功能。

我錯了? 我是否會通過選擇Windows手機Silverlight進入棄用之路?

注意:用於執行搜索的代碼是MSDN示例中的代碼...

WP8.1 XAML(諾基亞Lumia 1520,3秒與縮略圖,郵件帳戶等獲得240個聯系人......)

ContactStore agenda = await ContactManager.RequestStoreAsync();
Stopwatch sw = new Stopwatch();
IReadOnlyList<Windows.ApplicationModel.Contacts.Contact> contacts = null;
sw.Start();
contacts = await agenda.FindContactsAsync();
sw.Stop();
txtblock1.Text = sw.ElapsedMilliseconds;

WP Silverlight 8.1(諾基亞Lumia 1520,0.7秒獲得240個縮略圖,郵件賬號等聯系人......)

Contacts agenda = new Contacts();
//Stopwatch is declared at class level so its accessible in ListContacts_SearchCompleted Callback
sw.Start();
agenda.SearchCompleted+= ListContacts_SearchCompleted;
agenda.SearchAsync(String.Empty, FilterKind.None, null);
//sw.Stop() and print ElapsedMilliseconds in ListContacts_SearchCompleted callback

編輯:在論壇中創建的帖子有關此https://social.msdn.microsoft.com/forums/windowsdesktop/en-us/1e0accaf-b2f8-4d68-b5ec-dc6af6351633/findcontactsasync-takes-long-time?referrer=http: //social.msdn.microsoft.com/forums/windowsdesktop/en-us/1e0accaf-b2f8-4d68-b5ec-dc6af6351633/findcontactsasync-takes-long-time?referrer=http://social.msdn.microsoft.com/論壇/ windowsdesktop / EN-US / 1e0accaf-b2f8-4d68-b5ec-dc6af6351633 / findcontactsasync通吃長時間?論壇= wpdevelop

你在比較同樣的事情嗎?

在Silverlight版本中,您只能在完成處理程序中調用sw.Stop。

如果你真的想做一個很好的比較,你應該得到一個ETW跟蹤; 那么你真的可以理解正在發生的事情。

對於基於Metro XAML的解決方案,可能會有額外的互操作成本。 但這似乎是未來的道路。

對於Silverlight,現有的API可能更適合於perf。

也許你應該在兩個解決方案上工作,盡可能地使可共享代碼盡可能大,然后決定采用哪種方式。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM