Jump to content

Feedback: IPS is executing a slow statement 1000s times


Recommended Posts

In

ips/system/Output/Output.php::buildMetaTags()

There is this statement 

$rootPath = \IPS\Http\Url::external( \IPS\Settings::i()->base_url )->data['path'];

which is executing for every row in

\IPS\Db::i()->select( '*', 'core_seo_meta' )

Turns out, we have 8000+ rows in core_seo_meta rows in database, so this statement executes 8000 times, causing ~300ms delay in response

It would be better if the statement is moved out of forloop and executed only once.

Link to comment
Share on other sites

Nope. In first it's trying get meta seo data from datastore...

			if ( isset( \IPS\Data\Store::i()->metaTags ) )
			{
				$rows = \IPS\Data\Store::i()->metaTags;
			}
			else
			{
				$rows = iterator_to_array( \IPS\Db::i()->select( '*', 'core_seo_meta' ) );
				\IPS\Data\Store::i()->metaTags = $rows;
			}

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...