Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Instant Magento Performance Optimization How-to
  • Table Of Contents Toc
Instant Magento Performance Optimization How-to

Instant Magento Performance Optimization How-to

By : Nayrolles Mathieu (USD), Mathieu Nayrolles
3.9 (14)
close
close
Instant Magento Performance Optimization How-to

Instant Magento Performance Optimization How-to

3.9 (14)
By: Nayrolles Mathieu (USD), Mathieu Nayrolles

Overview of this book

The optimization of an attractive commercial website is a non-trivial task that demands time and knowledge. Optimization is a critical point for all growing businesses because a misconfiguration could make you lose money, a lot of money. If your server is overloaded, a browser that wants to turn into a buyer will not be able to, and you will lose customers. "Instant Magento Performance Optimization How-To" is a practical, hands-on guide that provides you with a number of clear, step-by-step exercises to help you reach a high performance level for your Magento stores and keep your customers satisfied.This book looks at tweaks and tips used to boost your Magento Performance, and breaks down the confusion that surrounds the subject.You will learn how to compress your pages, styles, and scripts by almost 80%. We will also take a look at controversial optimization settings such as Magento core compilation or enabling all caching systems. You will discover new applications that improve performance. If you wish your e-businesses to grow and want to keep your customers satisfied, you definitely need this book.
Table of Contents (7 chapters)
close
close

Using the Profiler (Should know)


Magento embeds a library to profile your Magento and detect some performance issues. In this recipe, we will see how to use it.

How to do it...

  1. Activate the Profiler by navigating to System | Configuration | Advanced | Developer | Debug.

  2. The second step is to enable the debugger in YOUR_STORE.COM/index.php near line 71 and remove the sharp so that it looks like the following:

    Varien_Profiler::enable();

    If you can't find this line anywhere, add it somewhere before the last line (Mage::run($mageRunCode, $mageRunType);). If you have successfully enabled the profile, all your web pages will have a new footer similar to the following:

How it works...

The table in your footer contains five columns; the first one, Code Profiler, contains your timer name associated to the second column, Time, which is the time when this timer has been reached. The third column, Cnt, counts the number of times you launch the same timer. Finally, the last two columns, Emalloc and RealMem stand for the amount of memory allocated to PHP. The difference between those two is that the parameter true is passed to the second one and is not passed to the first one.

The most important column to look at is the Cnt column, because it counts the number of instances of a specific object. And to instantiate an object is time consuming. A high number in the Cnt columns could mean that you made customizations that led to unnecessary object instantiations.

There's more...

Using the built-in timers can be enough, but for an effective debug you should use your own.

Adding your own timer

In addition to the native information provided by the Profiler, you can add your own timer. In order to do this, open the file you want to monitor and add the following statements:

Varien_Profiler::start('my_timer');
[some suspicious php code]
Varien_Profiler::stop('my_timer');
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Instant Magento Performance Optimization How-to
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon