SlideShare a Scribd company logo
Windows Phone
programming: pain and
how to deal with
Nguyen Thai Son
Agenda
1. Image Cache - Why? What we need? How to
used?
2. LINQ - Tip and trick to improve performance
Image Cache - Why? What
we need? How to used?
1.1 Image Cache mechanism in
WP
• Image has been cache in memory and has been
release by garbage collector
• Cache policy compliance with HTTP/1.1 Cache
Control directive
‒ Support Etag, max-age, Expires, Last-Modified …
1.2 Why we need other Image Cache?
• Windows Phone OS just cache your image in one session
• Current HTTP/1.1 Cache Control directive config is not the
best
• Need control memory consume and Image life cycle
1.3 What we need to Cache Image
Window phone programing   pain and how to deal with
Local Cache
• Organize by folder
• Used FIFO rule to roll cache
1.4 How to used
• Cache every thing you can
‒ Better on Control memory
• Short cache Temporary Image – which something
like this
HTTP/1.1 302 OK
Location: /default
Cache-Control: no-store, no-cache, must-revalidate
Date: Fri, 05 Jul 2013 20:05:03 GMT
Content-Length: 0
How to used (cont)
• Only take what you need
• Download Image from
Network should be held as
Stack and have limit Stack size
1
2
3
4
How to used (cont)
• Scheduled to clean up local cache to
avoid waste on disk - event permanent
Image
LINQ - Tip and trick to
improve performance
2.1.Existing problems with LINQ
• Write time increased when used one instance of
DataContext many time
0
50
100
150
200
250
50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 950 1000
Write time
One instance 50 item / instance 1 item / instance
Existing problems with LINQ (cont)
• Read time increased rapidly when amount of
record is growing
100 record 20K record
Read time (one
record)
15 ms 242 ms
2.2.How to improve
• Write batch of Query
Time (ms)
Write each query (1000 query) 17866
Write batch query(1000 query) 1835
How to improve (cont)
• Used CompiledQuery with Query has been called
frequently
‒ Translate Linq query to SQL query => Run the query =>
Retrieve the data
100 times 3000 times
Non Compiled Query 2427 ms 101039 ms
Compiled Query 739 ms 50702 ms
How to improve (cont)
• Only take which Entity you need
17
20K Record
Count Full Entity 2803
Count One Entity 607
Window phone programing   pain and how to deal with

More Related Content

PPTX
Stream upload and asynchronous job processing in large scale systems
PPTX
Server log, monitoring and qo s platform of a messaging app
PDF
JOSA TechTalk - Lambda architecture and real-time processing
PPTX
Inside Zalo: Developing a mobile messenger for the audience of millions - VN ...
KEY
The guardian and app engine
PDF
Reasonable app development
PDF
Your app works slowly. Now what?
PPT
Introduction to Django-Celery and Supervisor
Stream upload and asynchronous job processing in large scale systems
Server log, monitoring and qo s platform of a messaging app
JOSA TechTalk - Lambda architecture and real-time processing
Inside Zalo: Developing a mobile messenger for the audience of millions - VN ...
The guardian and app engine
Reasonable app development
Your app works slowly. Now what?
Introduction to Django-Celery and Supervisor

What's hot (15)

PPTX
ACM Patterns and Oracle BPM Suite Best Practises
PDF
Auto-Scalable REST APIs with YAWP! and Google Cloud
PDF
A Gentle Introduction to Functions-as-a-Service
PPTX
MongoDB World 2018: Using Puppet, Ansible and Ops Manager to Create Your Own ...
PPTX
Performance metrics for a social network
PPTX
The Top 10 Free and Open Source Project Management Software For Your Small Bu...
PPTX
MongoDB World 2018: Replatforming: Switching to MongoDB for Flexibility, Scal...
PPTX
How to tactically avoid boring work with Power Automate
PPT
Emily Kingsland & Marcela Y. Isuster: May the resource be with you: Free onli...
PPTX
When the connection fails
PPTX
Cloud computing presentation by Pinky
PDF
Fashiolista
PDF
Back from the Dead: When Bad Code Kills a Good Server
PPTX
PPTX
Developer day - AWS: Fast Environments = Fast Deployments
ACM Patterns and Oracle BPM Suite Best Practises
Auto-Scalable REST APIs with YAWP! and Google Cloud
A Gentle Introduction to Functions-as-a-Service
MongoDB World 2018: Using Puppet, Ansible and Ops Manager to Create Your Own ...
Performance metrics for a social network
The Top 10 Free and Open Source Project Management Software For Your Small Bu...
MongoDB World 2018: Replatforming: Switching to MongoDB for Flexibility, Scal...
How to tactically avoid boring work with Power Automate
Emily Kingsland & Marcela Y. Isuster: May the resource be with you: Free onli...
When the connection fails
Cloud computing presentation by Pinky
Fashiolista
Back from the Dead: When Bad Code Kills a Good Server
Developer day - AWS: Fast Environments = Fast Deployments
Ad

Viewers also liked (6)

PPTX
Tips and tricks to attack memory problem in android programming
PPTX
Inside Zalo: Developing a mobile messenger for the audience of millions - VN ...
PDF
Sơ lược kiến trúc hệ thống Zing Me
PDF
Building ZingMe News Feed System
PPTX
Experience lessons from architecture of zalo real time system
PDF
Zingme practice for building scalable website with PHP
Tips and tricks to attack memory problem in android programming
Inside Zalo: Developing a mobile messenger for the audience of millions - VN ...
Sơ lược kiến trúc hệ thống Zing Me
Building ZingMe News Feed System
Experience lessons from architecture of zalo real time system
Zingme practice for building scalable website with PHP
Ad

Similar to Window phone programing pain and how to deal with (20)

PPTX
ASP.NET MVC Performance
PPTX
Caching up is hard to do: Improving your Web Services' Performance
DOCX
High performance coding practices code project
PDF
Asp.net caching
PPTX
Design and Development performance considerations
PPTX
Scaling asp.net websites to millions of users
PDF
ASP.NET Scalability - DDD7
PPTX
Whats New for WPF in .NET 4.5
PPTX
Asp.net performance
PPTX
10 performance and scalability secrets of ASP.NET websites
PPTX
10 tips to make your ASP.NET Apps Faster
PDF
Hussein Beygi - 10 TIP for Performance of Iinq Queries.pdf
PDF
ASP.NET Scalability - NxtGen Oxford
PDF
ASP.NET Scalability - VBUG London
PPTX
Web Front End Performance
DOC
To Study The Tips Tricks Guidelines Related To Performance Tuning For N Hib...
PPTX
Entity framework advanced
PPTX
.NET Performance Tips #Visualized
PDF
ASP.NET Scalability - WebDD
PPTX
Sharepoint Performance - part 2
ASP.NET MVC Performance
Caching up is hard to do: Improving your Web Services' Performance
High performance coding practices code project
Asp.net caching
Design and Development performance considerations
Scaling asp.net websites to millions of users
ASP.NET Scalability - DDD7
Whats New for WPF in .NET 4.5
Asp.net performance
10 performance and scalability secrets of ASP.NET websites
10 tips to make your ASP.NET Apps Faster
Hussein Beygi - 10 TIP for Performance of Iinq Queries.pdf
ASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - VBUG London
Web Front End Performance
To Study The Tips Tricks Guidelines Related To Performance Tuning For N Hib...
Entity framework advanced
.NET Performance Tips #Visualized
ASP.NET Scalability - WebDD
Sharepoint Performance - part 2

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Encapsulation theory and applications.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Hybrid model detection and classification of lung cancer
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Mushroom cultivation and it's methods.pdf
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
Approach and Philosophy of On baking technology
A comparative study of natural language inference in Swahili using monolingua...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
A novel scalable deep ensemble learning framework for big data classification...
NewMind AI Weekly Chronicles - August'25-Week II
Encapsulation theory and applications.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Hybrid model detection and classification of lung cancer
Univ-Connecticut-ChatGPT-Presentaion.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Chapter 5: Probability Theory and Statistics
Enhancing emotion recognition model for a student engagement use case through...
DP Operators-handbook-extract for the Mautical Institute
Tartificialntelligence_presentation.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Mushroom cultivation and it's methods.pdf
1. Introduction to Computer Programming.pptx
Group 1 Presentation -Planning and Decision Making .pptx

Window phone programing pain and how to deal with

  • 1. Windows Phone programming: pain and how to deal with Nguyen Thai Son
  • 2. Agenda 1. Image Cache - Why? What we need? How to used? 2. LINQ - Tip and trick to improve performance
  • 3. Image Cache - Why? What we need? How to used?
  • 4. 1.1 Image Cache mechanism in WP • Image has been cache in memory and has been release by garbage collector • Cache policy compliance with HTTP/1.1 Cache Control directive ‒ Support Etag, max-age, Expires, Last-Modified …
  • 5. 1.2 Why we need other Image Cache? • Windows Phone OS just cache your image in one session • Current HTTP/1.1 Cache Control directive config is not the best • Need control memory consume and Image life cycle
  • 6. 1.3 What we need to Cache Image
  • 8. Local Cache • Organize by folder • Used FIFO rule to roll cache
  • 9. 1.4 How to used • Cache every thing you can ‒ Better on Control memory • Short cache Temporary Image – which something like this HTTP/1.1 302 OK Location: /default Cache-Control: no-store, no-cache, must-revalidate Date: Fri, 05 Jul 2013 20:05:03 GMT Content-Length: 0
  • 10. How to used (cont) • Only take what you need • Download Image from Network should be held as Stack and have limit Stack size 1 2 3 4
  • 11. How to used (cont) • Scheduled to clean up local cache to avoid waste on disk - event permanent Image
  • 12. LINQ - Tip and trick to improve performance
  • 13. 2.1.Existing problems with LINQ • Write time increased when used one instance of DataContext many time 0 50 100 150 200 250 50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 950 1000 Write time One instance 50 item / instance 1 item / instance
  • 14. Existing problems with LINQ (cont) • Read time increased rapidly when amount of record is growing 100 record 20K record Read time (one record) 15 ms 242 ms
  • 15. 2.2.How to improve • Write batch of Query Time (ms) Write each query (1000 query) 17866 Write batch query(1000 query) 1835
  • 16. How to improve (cont) • Used CompiledQuery with Query has been called frequently ‒ Translate Linq query to SQL query => Run the query => Retrieve the data 100 times 3000 times Non Compiled Query 2427 ms 101039 ms Compiled Query 739 ms 50702 ms
  • 17. How to improve (cont) • Only take which Entity you need 17 20K Record Count Full Entity 2803 Count One Entity 607