Your SlideShare is downloading. ×
0
Performance for Product Developers                                Matthew WilkesFriday, 12 October 12                     ...
Who am I?              •         Performance and security work                        at the Code Distillery              ...
Who am I?              •         Zope / Plone core developer              • Silly accent. Sorry.              • Not a morn...
Performance…             •          Plone is pretty damn fast             • Low edit sites are really easy                ...
Performance…            •       plone.app.caching takes about                    5 minutes to configure            •       ...
Performance…Friday, 12 October 12                  6
… for Product Developers?Friday, 12 October 12                               7
… for Product Developers             •          Security isn’t the sole                        responsibility of the integ...
some even over do itFriday, 12 October 12                          9
Recap             •          Don’t add things to the                        catalog if you can help it             •      ...
Recap             •          Build your types on                        Dexterity, not Archetypes             •          I...
Recap             •          Avoid big object churn by                        keeping Lengths of things                   ...
Recap             • If you see for loops inside                        for loops you’re probably                        mi...
… for Product Developers        •        Very few people are using the                 tools we have available        •   ...
Who’s used this?Friday, 12 October 12                      15
You guys! Seriously‽Friday, 12 October 12                          16
Access time for a browser view through Varnish     80ms                                 23     60ms                       ...
plone.app.caching       • Assign caching rules directly to contexts by              interface       • Can map to an operat...
psst, integrators!       •       You can have commit access               today       • If your favourite product doesn’t ...
Edge Side Includes                        photo (c) http://www.flickr.com/photos/fornal/Friday, 12 October 12              ...
ESIs                        • Varnish is your friend                        • Lets integrators do page                    ...
Friday, 12 October 12   22
ESI                        •   Suddenly, cache hits for                            logged in users!                       ...
ESI                  • Set ETags to                        roles|lastModified?                  • ETags can be faked      ...
ESI            • Integrators will still have to                        segment their cache manually                       ...
ESI            • Plan your templates for eventual                        ESIs            •           Many small templates ...
ESI        •        If there is a block of markup that                 is mostly static but uses the user                 ...
Testing caching                        photo (c) http://www.flickr.com/photos/alisdair/Friday, 12 October 12               ...
Testing            •           Far too few people run                        automated tests on their                     ...
Testing            • If you have plone.app.testing                        based tests already it’s easyish            •   ...
Things that need buildingFriday, 12 October 12                               31
Utility packages         •        We need helper classes and                  methods for writing caching tests         • ...
Rulesets            •           The current plone.app.caching                        rulesets are integrator focused      ...
The Code Distillery                                            Bristol                        Questions?       Want help p...
Upcoming SlideShare
Loading in...5
×

Performance for Product Developers

896

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
896
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
14
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Performance for Product Developers"

  1. 1. Performance for Product Developers Matthew WilkesFriday, 12 October 12 1
  2. 2. Who am I? • Performance and security work at the Code Distillery • Framework and security teams, membership committee • Foundation board memberFriday, 12 October 12 2
  3. 3. Who am I? • Zope / Plone core developer • Silly accent. Sorry. • Not a morning person. Sorry.Friday, 12 October 12 3
  4. 4. Performance… • Plone is pretty damn fast • Low edit sites are really easy to make fly • Runs fine on a 256mb VMFriday, 12 October 12 4
  5. 5. Performance… • plone.app.caching takes about 5 minutes to configure • Add Varnish and it goes really rather quick • Writing is harderFriday, 12 October 12 5
  6. 6. Performance…Friday, 12 October 12 6
  7. 7. … for Product Developers?Friday, 12 October 12 7
  8. 8. … for Product Developers • Security isn’t the sole responsibility of the integrator • Neither is performance • Everyone is careful about the code they writeFriday, 12 October 12 8
  9. 9. some even over do itFriday, 12 October 12 9
  10. 10. Recap • Don’t add things to the catalog if you can help it • If you have to, use an indexer, not just a raw FieldIndexFriday, 12 October 12 10
  11. 11. Recap • Build your types on Dexterity, not Archetypes • If you’re not sure what structure to use for your data, the answer is OOBTreeFriday, 12 October 12 11
  12. 12. Recap • Avoid big object churn by keeping Lengths of things you need • Find a balance between huge objects and annotation soupFriday, 12 October 12 12
  13. 13. Recap • If you see for loops inside for loops you’re probably missing a simpler way • Don’t forget sets and itertools, they’re goodFriday, 12 October 12 13
  14. 14. … for Product Developers • Very few people are using the tools we have available • Equally true for publicly available products as for policiesFriday, 12 October 12 14
  15. 15. Who’s used this?Friday, 12 October 12 15
  16. 16. You guys! Seriously‽Friday, 12 October 12 16
  17. 17. Access time for a browser view through Varnish 80ms 23 60ms 56 processing connect 40ms 20ms 0ms 0 without cache:ruleset with cache:ruleset I love this chartFriday, 12 October 12 17
  18. 18. plone.app.caching • Assign caching rules directly to contexts by interface • Can map to an operation, like plone.app.caching.strongCaching • or to a ruleset, like plone.content.itemViewFriday, 12 October 12 18
  19. 19. psst, integrators! • You can have commit access today • If your favourite product doesn’t have rulesets defined, add them • I’ll bring “I cleaned up your mess” stickers to BrasíliaFriday, 12 October 12 19
  20. 20. Edge Side Includes photo (c) http://www.flickr.com/photos/fornal/Friday, 12 October 12 20
  21. 21. ESIs • Varnish is your friend • Lets integrators do page composition • but easy to leak dataFriday, 12 October 12 21
  22. 22. Friday, 12 October 12 22
  23. 23. ESI • Suddenly, cache hits for logged in users! • aaaand, cache hits on private pages for anonymous • Really rather badFriday, 12 October 12 23
  24. 24. ESI • Set ETags to roles|lastModified? • ETags can be faked • Still leaks dataFriday, 12 October 12 24
  25. 25. ESI • Integrators will still have to segment their cache manually • Hard work • A lot easier if add-ons are written with this in mindFriday, 12 October 12 25
  26. 26. ESI • Plan your templates for eventual ESIs • Many small templates is appropriate, lets them be customisedFriday, 12 October 12 26
  27. 27. ESI • If there is a block of markup that is mostly static but uses the user in some bit, make sure that’s separated out • Integrators shouldn’t need more than a few minutes to add ESI to your templatesFriday, 12 October 12 27
  28. 28. Testing caching photo (c) http://www.flickr.com/photos/alisdair/Friday, 12 October 12 28
  29. 29. Testing • Far too few people run automated tests on their caching • Well, far too few people run automated tests at allFriday, 12 October 12 29
  30. 30. Testing • If you have plone.app.testing based tests already it’s easyish • Create a new layer using a ZServer and start up Varnish • Make some testbrowser callsFriday, 12 October 12 30
  31. 31. Things that need buildingFriday, 12 October 12 31
  32. 32. Utility packages • We need helper classes and methods for writing caching tests • Actual tests in popular packages, as examplesFriday, 12 October 12 32
  33. 33. Rulesets • The current plone.app.caching rulesets are integrator focused • We need some standard ones for product developers to useFriday, 12 October 12 33
  34. 34. The Code Distillery Bristol Questions? Want help putting this into practice? sales@thedistillery.euFriday, 12 October 12 34
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×