You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$re = new ReflectionExtension('midgard2');
$classes = $re->getClasses();
$counter = 0;
$start = microtime(true);
foreach ($classes as $refclass)
{
if (!$refclass->isSubclassOf('midgard_object'))
{
continue;
}
$type = $refclass->getName();
if (midgard_storage::class_storage_exists($type))
{
$counter++;
}
}
echo "found " . $counter . " schema types in " . round(microtime(true) - $start, 2) . "s";
I get the following output:
found 85 schema types in 154,82s
This is on a quad-core Xeon machine with 5GB of RAM, so I don't think it's a hardware thing. Either midgard_storage or the reflection calls must be really slow. It would be nice if this could be improved, for developing, this gets quite tiresome.
The text was updated successfully, but these errors were encountered:
But still, two seconds to check if a table exists is really a lot of time, it almost sounds as if it creates the metadata database on the fly for each method call. I wonder if some of the work it does couldn't be avoided somehow. BTW: If I call midgard_storage::class_storage_exists() twice per type in the loop, the runtime practically doubles (151s vs. 295s)
piotras
added a commit
to piotras/midgard-core
that referenced
this issue
Feb 24, 2012
When I run this code
I get the following output:
This is on a quad-core Xeon machine with 5GB of RAM, so I don't think it's a hardware thing. Either midgard_storage or the reflection calls must be really slow. It would be nice if this could be improved, for developing, this gets quite tiresome.
The text was updated successfully, but these errors were encountered: