Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7044737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:26:43+00:00 2026-05-28T02:26:43+00:00

Magento has a fallback mechanism that helps prevent errors and theming problems by checking

  • 0

Magento has a fallback mechanism that helps prevent errors and theming problems by checking for the existence of expected files through a defined set of paths. It’s implemented like this:

/**
 * Check for files existence by specified scheme
 *
 * If fallback enabled, the first found file will be returned. Otherwise the base package / default theme file,
 *   regardless of found or not.
 * If disabled, the lookup won't be performed to spare filesystem calls.
 *
 * @param string $file
 * @param array &$params
 * @param array $fallbackScheme
 * @return string
 */
protected function _fallback($file, array &$params, array $fallbackScheme = array(array()))
{
    if ($this->_shouldFallback) {
        foreach ($fallbackScheme as $try) {
            $params = array_merge($params, $try);
            $filename = $this->validateFile($file, $params);
            if ($filename) {
                return $filename;
            }
        }
        $params['_package'] = self::BASE_PACKAGE;
        $params['_theme']   = self::DEFAULT_THEME;
    }
    return $this->_renderFilename($file, $params);
}

As a Magento theme developer you have two options: You can add as little as possible to your new theme and depend on the fallback, or you can copy everything from the fallback theme into your new theme and modify that (in which case the fallback has to iterate over fewer files before finding its target). The former approach is recommended. The latter is not.

Copying those files is certainly messy, but on the other hand it seems the fallback should be fairly expensive, particularly if (being a good, pithy coder) you make sure as many files fall back as possible. So I find myself wondering if a Magento site will perform better if I take steps to minimize the amount of fallback that happens.

I’ve searched the web, but haven’t found any information about this question, and I’m not yet familiar enough with Magento to profile the fallback myself. Is there any information about the actual performance cost of this fallback mechanism?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:26:44+00:00Added an answer on May 28, 2026 at 2:26 am

    The performance cost is 37.

    Less snarkily: Your question is, unfortunately, unanswerable. While there’s (obviously) a performance cost to stating those files and directories, Magento (and any LAMP application) will hit performance bottlenecks due to SQL overhead and CPU much sooner than it will due to other factors. Performance tuning of modern web applications tends not to happen on the the application level, but instead treating the application as an unchangeable blob and purchasing/configuring the best possible hardware setup.

    If anyone has benchmarked Magento with fallback on or off, they haven’t shared the information publicly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running a Magento site that has different prices for different user groups. I'd
A client has asked me to reduce the complexity of Magento's …/template/checkout/cart/shipping.phtml so that
We have an install that is currently running Magento CE v1.5 (it has been
I am working on a Magento module that has a Form where a user
I do have my own Controller in Magento, that has been done by following
Is there a way to programmatically reopen an order in Magento that has already
I am working on a Magento store that has a custom embroidery option for
Magento checkout broken in IE9 and IE8 for that matter When testing our checkout
Magento 1.4.2 Having compilation errors and the page doesn't render. I get errors but
Our Magento store uses the Website Payments Pro payment gateway through PayPal. For the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.