View Issue Details

IDProjectCategoryView StatusLast Update
0000816OXID eShop (all versions)4.09. SEO, SEO URLpublic2012-12-10 13:35
Reporterdainius.bigelis Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.1.0 revision 17976 
Fixed in Version4.1.1 revision 18442 
Summary0000816: Huge amount of cycles executed for removing duplicated META keywords
DescriptionWhen there are lot of words in the META keywords (i.e. few thousands keywords), the function for removing duplicated keywords runs huge amount of cycles (can be few hundred of thousands). It slows down the page significantly.

Fix this place to solve the removing duplicated entries in other way, to improve performance.
TagsNo tags attached.
Theme
BrowserAll
PHP Version5.2.6
Database Version5.0.33

Activities

vilma_liorensaityte

2009-04-22 10:42

reporter   ~0000795

In oxUbase::_removeDuplicatedWords changed this foreach:

foreach ( $aStrings as $iANum => $sAString ) {
    $sAString = $oStr->strtolower( $sAString );
    foreach ( $aStrings as $iBNum => $sBString ) {
          // duplicates
          $sBString = $oStr->strtolower( $sBString );
          if ( $sAString && $iANum != $iBNum && strcmp( $sAString, $sBString ) === 0 ) {
              unset( $aStrings[$iANum] );
          }
     }
}

to this code:

$sCount = count($aStrings);
for ( $iNum = 0; $iNum < $sCount; $iNum++ ) {
    $aStrings[$iNum] = $oStr->strtolower( $aStrings[$iNum] );
}
// duplicates
$aStrings = array_unique($aStrings);