Welcome Guest, Not a member yet? Register   Sign In
HMVC vs MVC speed comparison ... any ?
#1

[eluser]ckissi[/eluser]
Hello,

Anybody tested/compared performance/speed for both ?

If you go to MY_Router.php (for HMVC) you can see tons of is_dir and is_file function calls in "locate" function. I really wonder how it affects speed as it makes tons of tests before files are included and executed.

Code:
foreach (Modules::$locations as $location => $offset) {
        
            /* module exists? */
            if (is_dir($source = $location.$module.'/controllers/')) {
                
                $this->module = $module;
                $this->directory = $offset.$module.'/controllers/';
                
                /* module sub-controller exists? */
                if($directory AND is_file($source.$directory.$ext)) {
                    return array_slice($segments, 1);
                }
                    
                /* module sub-directory exists? */
                if($directory AND is_dir($module_subdir = $source.$directory.'/')) {
                            
                    $this->directory .= $directory.'/';

                    /* module sub-directory controller exists? */
                    if(is_file($module_subdir.$directory.$ext)) {
                        return array_slice($segments, 1);
                    }
                
                    /* module sub-directory sub-controller exists? */
                    if($controller AND is_file($module_subdir.$controller.$ext))    {
                        return array_slice($segments, 2);
                    }
                }
            
                /* module controller exists? */            
                if(is_file($source.$module.$ext)) {
                    return $segments;
                }
            }
        }

We would like to go for HMVC but it's mission critical application when it comes to speed and currently there seems to be a big disadvantage because of these file/dir test functions.


Messages In This Thread
HMVC vs MVC speed comparison ... any ? - by El Forum - 11-04-2010, 10:15 AM
HMVC vs MVC speed comparison ... any ? - by El Forum - 11-04-2010, 06:11 PM
HMVC vs MVC speed comparison ... any ? - by El Forum - 11-04-2010, 06:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB