Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Odoo - CMS performances optimization


Published on

What has been done in odoo in terms of performance
optimization ?

Published in: Technology
  • Hi All, If you are looking for Technical Blogs or want to read about vTiger, Odoo, OpenERP, Microsoft Apps, Google Apps, CRM, ERPs, Mobile Apps and New things in IT industry then read and subscribe on OR go to for CRM and ERP purchase consultation. We also design mobile apps and mobile responsive web sites of businesses and E-Commerce
    Are you sure you want to  Yes  No
    Your message goes here

Odoo - CMS performances optimization

  1. 1. CMS performances optimization Fabien Meghazi
  2. 2. Performance Refers to the capability of a system to provide a certain response time.
  3. 3. Performance What has been done in odoo in terms of performance optimization ?
  4. 4. Performance 1. A new type of view (QWeb) 2. Asset bundlesAsset bundles
  5. 5. Performance Here's what we can find in the document > body > head of most CMS's default setup. <head><head> <link<link href="/files/css/css_pbm0lsQQJ7A7WCCIMgxLho6mI_kBNgznNUWmTWcnfoE.css" type="text/css" rel="stylesheet" <link<link href="/files/css/css_GgerrJ1eO2p2FAGV0vkRGdFa8QLXDr0-mUgvpPQTbXU.css" type="text/css" rel="stylesheet" <link<link href="/files/css/css_GLOpzAhXMtWYvS4h5wbl6MtSyjZs8gh4uS0H2yCFKMQ.css" type="text/css" rel="stylesheet" <link<link href="/files/css/css_FA2n7wdGXAxEt6RZrMKCEcj3lLJtYSo_M5fkYjNGzYY.css" type="text/css" rel="stylesheet" <link<link href="/files/css/css_BxX7fMKqodl8G9DZ2zEO8tz0u1pex3OS77VssQ6kAbs.css" type="text/css" rel="stylesheet" <script<script src="/files/js/js_xAPl0qIk9eowy_iS9tNkCWXLUVoat94SQT48UBCFkyQ.js" type="text/javascript"></script>></script> <script<script src="/files/js/js_pWaEh3PAhCcBT2MOtrKzosTxS9eM5SUYFirhq9KQa0M.js" type="text/javascript"></script>></script> <script<script src="/files/js/js_sqDzf_5suPJcQpKY1lVF0I5wO_5bUrj5RwpiTKV3w3o.js" type="text/javascript"></script>></script> <script<script src="/files/js/js_TA8qfKqSlPTRUeVEmNo6g-LK6_BQOwPCT-lpp_13vP8.js" type="text/javascript"></script>></script> <script<script src="/files/js/js_rv_BKYv7yieH0IgHddhWHDC-bWGan8yiJbusyOpr0mw.js" type="text/javascript"></script>></script> <script<script src="/files/js/js_fZbsGtwY7jnTvjaAvTzUEFJKO-FkHlZC6o1x2O_56wc.js" type="text/javascript"></script>></script> ...
  6. 6. Performance Why is it a problem? BrowserBrowser Max. concurrent connections per domainMax. concurrent connections per domain Firefox 3+ 6 Opera 12+ 6 Safari 5+ 6 IE 8 6 IE 10 8 Chrome 6 Lack of @aync or @defer makes javascript loading synchronous.
  7. 7. Performance Solved by asset bundles! <head><head> <link<link href="/web/css/website.assets_frontend" rel="stylesheet"/>/> <script<script src="/web/js/website.assets_frontend"></script>></script> An asset bundle automatically concatenates and minifies javascripts and stylesheets in order to reduce the page load latency. Of course, once a bundle is generated, it's cached. <script<script src="/web/js/website.assets_frontend/da39a3e"></script>></script> Versioned bundles (still to be merged in master for v8)
  8. 8. Performance Asset bundles are Odoo views too (ir.ui.view) ! <template<template id="my_theme" inherit_id="website.assets_frontend">> <xpath<xpath expr="." position="inside">> <script<script src="/my_theme/static/src/js/my_theme.js"></script>></script> <link<link href="/my_theme/static/src/css/my_theme.css" rel="stylesheet"/>/> </xpath></xpath> </template></template> As such, they benefit of all the advantages we just talked about in the previous topics.
  9. 9. Performance 1. A new type of view (QWeb) 2. Asset bundles 3. E-tags for imagesE-tags for images
  10. 10. Scalability Ability of a system to handle a growing amount of work in a capable manner.
  11. 11. Scalability What does Odoo provides in terms of scalability? 1. ORM prefetchORM prefetch # res.partner companies ==[(([('is_company',,'=',,True)]))]) forfor company inin companies:: forfor contact inin company..child_ids:: ifif contact..country_id:: printprint u"%s : %s" %% ((,,
  12. 12. Scalability An ORM lacking prefetch can't provide an efficient SQL query plan: -- 1 query - N results SELECTSELECT ...... FROMFROM res_partner -- N queries - M results SELECTSELECT ...... FROMFROM res_partner WHEREWHERE parent_id == <<id>> -- N*M queries SELECTSELECT ...... FROMFROM res_country WHEREWHERE id == <<id>> On 200 companies with ~2 linked partners each would cause those nested loops to make 601 SQL queries. In Odoo, the chains of browse record lists allows the ORM to efficiently plan the same operations in 5 SQL queries
  13. 13. Scalability 1. ORM prefetch 2. Preforked workers (same as Gunicorn)Preforked workers (same as Gunicorn)
  14. 14. Results Want detailed results, benchmarks and comparison of performance? Please attend to the "Open Source CMS: a performance comparison" talk by Mantavya Gajjar in this room at 16:20.
  15. 15. Questions ?
  16. 16. Thanks for listening !