SlideShare a Scribd company logo
1 of 10
5-steps to
Optimizing WCF
services
Punit Ganshani
Twitter -
                                                   @ganshani
                                                   @codetails

                                                   LinkedIn -
                                                   Connect

                                                   SlideShare –
                                                   View Presentations

                                                   Blog Sites –
                                                   www.ganshani.com
                                                   www.codetails.com
                                                   Open Source –
                                                   CodeInject, Workflow
                                                   Extractor, dI.Hook


Punit Ganshani
Punit Ganshani is a Technology Evangelist practising application design &
development on C#, WCF, WP8, WinRT and Open Source. He is an open-
source contributor on CodePlex, has several applications on Windows Phone
Store, author of a book, and 18+ whitepapers in international magazines.
Choose the right binding




            Source: http://weblogs.asp.net/blogs/spano/WCFBindings.JPG
Choosing the Encoder

     Text         Default encoder
• BasicHttpBinding and WsHttpBinding
• Uses XML UTF-8 encoding


    MTOM          Interoperable format
• More optimized transmission of binary blobs
• Not base-64 encoded, hence faster


    Binary        Default encoder w/binary format
• NetTcpBinding and NetNamedPipeBinding
• Avoids base64 encoding and use Session Encoders
• Uses a dictionary-based algorithm to avoid data duplication
Which Encoder?

▪ Supports the right binding
▪ Size of the message
   ▪ Choose one that shortens your message
   ▪ Smaller the size of message, faster it will be transferred
▪ Check the CPU load
   ▪ Encoding takes time and CPU cycles
▪ Keep it Simple Stupid (KISS)
   ▪ Remove redundant attributes / properties from message
   ▪ Keep it binary if possible
▪ Interoperable
   ▪ MTOM – check for interoperability with non-WCF services
Session Encoders.. Build / reuse

▪ Binary encoder has Session Encoders
   ▪ Builds a dictionary based on pattern of messages
   ▪ Uses dictionary and analysis pattern for encoding
   ▪ Optimizes speed as time goes by
▪ Other encoders
   ▪ Build your own session encoder
Compress after encoding

▪ A right encoder reduces message size by 4-5 times
▪ But the shorter the message, the better
   ▪ WAS/IIS Hosted Service: Use IIS compression
   ▪ Others: Uses GZip and Deflate mechanisms for all
     outgoing/incoming messages

▪ For custom compression, hook the encoder and
  apply compression techniques
Cache

▪ Register your dependencies, and locate them
  when required
▪ Consider caching data,
   ▪ In memory Cache -
      ▪ Ideal for small sized application hosted on a single
        instance/server
      ▪ WAS/IIS Hosted Services: Use ASP.NET Caching Services or
        Runtime Caching
      ▪ Self hosted: Use Enterprise Library
   ▪ App-Fabric:
      ▪ Ideal for distributed hosted applications
      ▪ Overcomes several problems such as sticky sessions,
        component-dependent caching, dirty cache and cache-
        synchronizing
Small things, big difference

▪ Load Balance:
   ▪ Increases scalability
   ▪ Increases performance
▪ Use GPU for data computing:
   ▪ Accelerator by Microsoft
   ▪ CUDA by NVIDIA
5 steps to Optimizing WCF Services

More Related Content

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

5 steps to Optimizing WCF Services

  • 2. Twitter - @ganshani @codetails LinkedIn - Connect SlideShare – View Presentations Blog Sites – www.ganshani.com www.codetails.com Open Source – CodeInject, Workflow Extractor, dI.Hook Punit Ganshani Punit Ganshani is a Technology Evangelist practising application design & development on C#, WCF, WP8, WinRT and Open Source. He is an open- source contributor on CodePlex, has several applications on Windows Phone Store, author of a book, and 18+ whitepapers in international magazines.
  • 3. Choose the right binding Source: http://weblogs.asp.net/blogs/spano/WCFBindings.JPG
  • 4. Choosing the Encoder Text Default encoder • BasicHttpBinding and WsHttpBinding • Uses XML UTF-8 encoding MTOM Interoperable format • More optimized transmission of binary blobs • Not base-64 encoded, hence faster Binary Default encoder w/binary format • NetTcpBinding and NetNamedPipeBinding • Avoids base64 encoding and use Session Encoders • Uses a dictionary-based algorithm to avoid data duplication
  • 5. Which Encoder? ▪ Supports the right binding ▪ Size of the message ▪ Choose one that shortens your message ▪ Smaller the size of message, faster it will be transferred ▪ Check the CPU load ▪ Encoding takes time and CPU cycles ▪ Keep it Simple Stupid (KISS) ▪ Remove redundant attributes / properties from message ▪ Keep it binary if possible ▪ Interoperable ▪ MTOM – check for interoperability with non-WCF services
  • 6. Session Encoders.. Build / reuse ▪ Binary encoder has Session Encoders ▪ Builds a dictionary based on pattern of messages ▪ Uses dictionary and analysis pattern for encoding ▪ Optimizes speed as time goes by ▪ Other encoders ▪ Build your own session encoder
  • 7. Compress after encoding ▪ A right encoder reduces message size by 4-5 times ▪ But the shorter the message, the better ▪ WAS/IIS Hosted Service: Use IIS compression ▪ Others: Uses GZip and Deflate mechanisms for all outgoing/incoming messages ▪ For custom compression, hook the encoder and apply compression techniques
  • 8. Cache ▪ Register your dependencies, and locate them when required ▪ Consider caching data, ▪ In memory Cache - ▪ Ideal for small sized application hosted on a single instance/server ▪ WAS/IIS Hosted Services: Use ASP.NET Caching Services or Runtime Caching ▪ Self hosted: Use Enterprise Library ▪ App-Fabric: ▪ Ideal for distributed hosted applications ▪ Overcomes several problems such as sticky sessions, component-dependent caching, dirty cache and cache- synchronizing
  • 9. Small things, big difference ▪ Load Balance: ▪ Increases scalability ▪ Increases performance ▪ Use GPU for data computing: ▪ Accelerator by Microsoft ▪ CUDA by NVIDIA