SlideShare a Scribd company logo
1 of 34
Download to read offline
Performance for Product Developers
                                Matthew Wilkes
Friday, 12 October 12                        1
Who am I?

              •         Performance and security work
                        at the Code Distillery
              •         Framework and security teams,
                        membership committee
              •         Foundation board member

Friday, 12 October 12                                   2
Who am I?

              •         Zope / Plone core developer
              • Silly accent. Sorry.

              • Not a morning person.          Sorry.


Friday, 12 October 12                                   3
Performance…

             •          Plone is pretty damn fast
             • Low edit sites are really easy
                        to make fly
             •          Runs fine on a 256mb VM


Friday, 12 October 12                               4
Performance…

            •       plone.app.caching takes about
                    5 minutes to configure
            •       Add Varnish and it goes really
                    rather quick
            •       Writing is harder

Friday, 12 October 12                                5
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 integrator
                          • Neither is performance
             • Everyone is careful about the
                        code they write

Friday, 12 October 12                                      8
some even over do it
Friday, 12 October 12                          9
Recap

             •          Don’t add things to the
                        catalog if you can help it
             •          If you have to, use an indexer,
                        not just a raw FieldIndex

Friday, 12 October 12                                     10
Recap

             •          Build your types on
                        Dexterity, not Archetypes
             •          If you’re not sure what
                        structure to use for your
                        data, the answer is OOBTree

Friday, 12 October 12                                 11
Recap

             •          Avoid big object churn by
                        keeping Lengths of things
                        you need
             •          Find a balance between huge
                        objects and annotation soup

Friday, 12 October 12                                 12
Recap

             • If you see for loops inside
                        for loops you’re probably
                        missing a simpler way

             • Don’t forget sets and
                        itertools, they’re good

Friday, 12 October 12                               13
… for Product Developers

        •        Very few people are using the
                 tools we have available
        •        Equally true for publicly available
                 products as for policies

Friday, 12 October 12                                  14
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
                                 56                                  processing
                                                                     connect
     40ms


     20ms


         0ms                                            0
                        without cache:ruleset   with cache:ruleset




                          I love this chart
Friday, 12 October 12                                                             17
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.itemView


Friday, 12 October 12                                   18
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ília
Friday, 12 October 12                                19
Edge Side Includes




                        photo (c) http://www.flickr.com/photos/fornal/
Friday, 12 October 12                                                   20
ESIs

                        • Varnish is your friend
                        • Lets integrators do page
                            composition
                        •   but easy to leak data

Friday, 12 October 12                                21
Friday, 12 October 12   22
ESI

                        •   Suddenly, cache hits for
                            logged in users!
                        • aaaand, cache hits on private
                            pages for anonymous
                              •   Really rather bad
Friday, 12 October 12                                     23
ESI

                  • Set ETags to
                        roles|lastModified?

                  • ETags can be faked
                  • Still leaks data
Friday, 12 October 12                         24
ESI

            • Integrators will still have to
                        segment their cache manually
                           •   Hard work
            •           A lot easier if add-ons are
                        written with this in mind

Friday, 12 October 12                                  25
ESI

            • Plan your templates for eventual
                        ESIs
            •           Many small templates is
                        appropriate, lets them be
                        customised

Friday, 12 October 12                               26
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 templates
Friday, 12 October 12                                 27
Testing caching




                        photo (c) http://www.flickr.com/photos/alisdair/
Friday, 12 October 12                                                 28
Testing

            •           Far too few people run
                        automated tests on their
                        caching
            •           Well, far too few people run
                        automated tests at all

Friday, 12 October 12                                  29
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 calls

Friday, 12 October 12                                      30
Things that need building




Friday, 12 October 12                               31
Utility packages

         •        We need helper classes and
                  methods for writing caching tests
         •        Actual tests in popular packages,
                  as examples


Friday, 12 October 12                                 32
Rulesets

            •           The current plone.app.caching
                        rulesets are integrator focused
            •           We need some standard ones
                        for product developers to use


Friday, 12 October 12                                     33
The Code Distillery
                                            Bristol




                        Questions?

       Want help putting this into practice?
        sales@thedistillery.eu
Friday, 12 October 12                                  34

More Related Content

Similar to Performance for Product Developers

Things I hate to do as a designer but do anyway
Things I hate to do as a designer but do anywayThings I hate to do as a designer but do anyway
Things I hate to do as a designer but do anywayMatt Johnston
 
[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java Interop[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java InteropAndrey Breslav
 
Optimizing WordPress Performance on Shared Web Hosting
Optimizing WordPress Performance on Shared Web HostingOptimizing WordPress Performance on Shared Web Hosting
Optimizing WordPress Performance on Shared Web HostingJon Brown
 
Why not to use Rails? (actually it's when not to use Rails)
Why not to use Rails? (actually it's when not to use Rails)Why not to use Rails? (actually it's when not to use Rails)
Why not to use Rails? (actually it's when not to use Rails)Arik Fraimovich
 
Introduction to the Disruptor
Introduction to the DisruptorIntroduction to the Disruptor
Introduction to the DisruptorTrisha Gee
 
MySQL Cluster no PayPal
MySQL Cluster no PayPalMySQL Cluster no PayPal
MySQL Cluster no PayPalMySQL Brasil
 
OmniOS Motivation and Design ~ LISA 2012
OmniOS Motivation and Design ~ LISA 2012OmniOS Motivation and Design ~ LISA 2012
OmniOS Motivation and Design ~ LISA 2012Theo Schlossnagle
 
Java performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha GeeJava performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha GeeJAX London
 
Enterprise javascriptsession1
Enterprise javascriptsession1Enterprise javascriptsession1
Enterprise javascriptsession1Troy Miles
 
2012 Q4 Cooperative Support for CAS Update
2012 Q4 Cooperative Support for CAS Update2012 Q4 Cooperative Support for CAS Update
2012 Q4 Cooperative Support for CAS UpdateAndrew Petro
 
GitHub Notable OSS Project
GitHub  Notable OSS ProjectGitHub  Notable OSS Project
GitHub Notable OSS Projectroumia
 
Adapt and respond: keeping responsive into the future
Adapt and respond: keeping responsive into the futureAdapt and respond: keeping responsive into the future
Adapt and respond: keeping responsive into the futureChris Mills
 
Dan node meetup_socket_talk
Dan node meetup_socket_talkDan node meetup_socket_talk
Dan node meetup_socket_talkIshi von Meier
 
Fast Mobile UIs
Fast Mobile UIsFast Mobile UIs
Fast Mobile UIsWooga
 
Inside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudInside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudAtlassian
 
Big Data - architectural concerns for the new age
Big Data - architectural concerns for the new ageBig Data - architectural concerns for the new age
Big Data - architectural concerns for the new ageDebasish Ghosh
 
MuraCon 2012 - Creating a Mura CMS plugin with FW/1
MuraCon 2012 - Creating a Mura CMS plugin with FW/1MuraCon 2012 - Creating a Mura CMS plugin with FW/1
MuraCon 2012 - Creating a Mura CMS plugin with FW/1jpanesar
 
Make something real for Firefox OS with Mozilla app templates
Make something real  for Firefox OS with Mozilla app templatesMake something real  for Firefox OS with Mozilla app templates
Make something real for Firefox OS with Mozilla app templatesPiotr Zalewa
 

Similar to Performance for Product Developers (20)

[Phind] Miracle
[Phind] Miracle[Phind] Miracle
[Phind] Miracle
 
Things I hate to do as a designer but do anyway
Things I hate to do as a designer but do anywayThings I hate to do as a designer but do anyway
Things I hate to do as a designer but do anyway
 
[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java Interop[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java Interop
 
Optimizing WordPress Performance on Shared Web Hosting
Optimizing WordPress Performance on Shared Web HostingOptimizing WordPress Performance on Shared Web Hosting
Optimizing WordPress Performance on Shared Web Hosting
 
Why not to use Rails? (actually it's when not to use Rails)
Why not to use Rails? (actually it's when not to use Rails)Why not to use Rails? (actually it's when not to use Rails)
Why not to use Rails? (actually it's when not to use Rails)
 
Introduction to the Disruptor
Introduction to the DisruptorIntroduction to the Disruptor
Introduction to the Disruptor
 
MySQL Cluster no PayPal
MySQL Cluster no PayPalMySQL Cluster no PayPal
MySQL Cluster no PayPal
 
OmniOS Motivation and Design ~ LISA 2012
OmniOS Motivation and Design ~ LISA 2012OmniOS Motivation and Design ~ LISA 2012
OmniOS Motivation and Design ~ LISA 2012
 
Java performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha GeeJava performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha Gee
 
Enterprise javascriptsession1
Enterprise javascriptsession1Enterprise javascriptsession1
Enterprise javascriptsession1
 
Iwmn architecture
Iwmn architectureIwmn architecture
Iwmn architecture
 
2012 Q4 Cooperative Support for CAS Update
2012 Q4 Cooperative Support for CAS Update2012 Q4 Cooperative Support for CAS Update
2012 Q4 Cooperative Support for CAS Update
 
GitHub Notable OSS Project
GitHub  Notable OSS ProjectGitHub  Notable OSS Project
GitHub Notable OSS Project
 
Adapt and respond: keeping responsive into the future
Adapt and respond: keeping responsive into the futureAdapt and respond: keeping responsive into the future
Adapt and respond: keeping responsive into the future
 
Dan node meetup_socket_talk
Dan node meetup_socket_talkDan node meetup_socket_talk
Dan node meetup_socket_talk
 
Fast Mobile UIs
Fast Mobile UIsFast Mobile UIs
Fast Mobile UIs
 
Inside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudInside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private Cloud
 
Big Data - architectural concerns for the new age
Big Data - architectural concerns for the new ageBig Data - architectural concerns for the new age
Big Data - architectural concerns for the new age
 
MuraCon 2012 - Creating a Mura CMS plugin with FW/1
MuraCon 2012 - Creating a Mura CMS plugin with FW/1MuraCon 2012 - Creating a Mura CMS plugin with FW/1
MuraCon 2012 - Creating a Mura CMS plugin with FW/1
 
Make something real for Firefox OS with Mozilla app templates
Make something real  for Firefox OS with Mozilla app templatesMake something real  for Firefox OS with Mozilla app templates
Make something real for Firefox OS with Mozilla app templates
 

Performance for Product Developers

  • 1. Performance for Product Developers Matthew Wilkes Friday, 12 October 12 1
  • 2. Who am I? • Performance and security work at the Code Distillery • Framework and security teams, membership committee • Foundation board member Friday, 12 October 12 2
  • 3. Who am I? • Zope / Plone core developer • Silly accent. Sorry. • Not a morning person. Sorry. Friday, 12 October 12 3
  • 4. Performance… • Plone is pretty damn fast • Low edit sites are really easy to make fly • Runs fine on a 256mb VM Friday, 12 October 12 4
  • 5. Performance… • plone.app.caching takes about 5 minutes to configure • Add Varnish and it goes really rather quick • Writing is harder Friday, 12 October 12 5
  • 7. … for Product Developers? Friday, 12 October 12 7
  • 8. … for Product Developers • Security isn’t the sole responsibility of the integrator • Neither is performance • Everyone is careful about the code they write Friday, 12 October 12 8
  • 9. some even over do it Friday, 12 October 12 9
  • 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 FieldIndex Friday, 12 October 12 10
  • 11. Recap • Build your types on Dexterity, not Archetypes • If you’re not sure what structure to use for your data, the answer is OOBTree Friday, 12 October 12 11
  • 12. Recap • Avoid big object churn by keeping Lengths of things you need • Find a balance between huge objects and annotation soup Friday, 12 October 12 12
  • 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 good Friday, 12 October 12 13
  • 14. … for Product Developers • Very few people are using the tools we have available • Equally true for publicly available products as for policies Friday, 12 October 12 14
  • 15. Who’s used this? Friday, 12 October 12 15
  • 16. You guys! Seriously‽ Friday, 12 October 12 16
  • 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 chart Friday, 12 October 12 17
  • 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.itemView Friday, 12 October 12 18
  • 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ília Friday, 12 October 12 19
  • 20. Edge Side Includes photo (c) http://www.flickr.com/photos/fornal/ Friday, 12 October 12 20
  • 21. ESIs • Varnish is your friend • Lets integrators do page composition • but easy to leak data Friday, 12 October 12 21
  • 23. ESI • Suddenly, cache hits for logged in users! • aaaand, cache hits on private pages for anonymous • Really rather bad Friday, 12 October 12 23
  • 24. ESI • Set ETags to roles|lastModified? • ETags can be faked • Still leaks data Friday, 12 October 12 24
  • 25. ESI • Integrators will still have to segment their cache manually • Hard work • A lot easier if add-ons are written with this in mind Friday, 12 October 12 25
  • 26. ESI • Plan your templates for eventual ESIs • Many small templates is appropriate, lets them be customised Friday, 12 October 12 26
  • 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 templates Friday, 12 October 12 27
  • 28. Testing caching photo (c) http://www.flickr.com/photos/alisdair/ Friday, 12 October 12 28
  • 29. Testing • Far too few people run automated tests on their caching • Well, far too few people run automated tests at all Friday, 12 October 12 29
  • 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 calls Friday, 12 October 12 30
  • 31. Things that need building Friday, 12 October 12 31
  • 32. Utility packages • We need helper classes and methods for writing caching tests • Actual tests in popular packages, as examples Friday, 12 October 12 32
  • 33. Rulesets • The current plone.app.caching rulesets are integrator focused • We need some standard ones for product developers to use Friday, 12 October 12 33
  • 34. The Code Distillery Bristol Questions? Want help putting this into practice? sales@thedistillery.eu Friday, 12 October 12 34