O'Reilly logo

Plone 3 Products Development Cookbook by Marcos F. Romero, Juan Pablo Giménez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Improving performance by tweaking expensive code

Not all performance problems will be solved by installing and configuring CacheFu. Sometimes there are serious issues in the very code because it could have been coded in a different and more efficient way, or just because of some job that takes too long.

Let's leave the inefficiency problem aside. Many times we perform expensive tasks like searching objects in the catalog, getting images, accessing external relational databases, or accessing web services, and we know in advance that they will be necessary again and again. How to deal with them? Or at least, how to make them more efficient?

In this section, we will see three alternative approaches to tackle this problem:

  1. @view.memoize decorators. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required