Today I started converting my project to symfony 1.1 in favor of the
customization goodies (I need sfNoRouting) which drives me into speed
nightmare. In dev environment, every request costs 15 seconds which is
totally unacceptable.
I found this is caused by the behavior of Doctrine library.
When you execute "Doctrine::getTable('Foo');". Doctrine will first
attempt to search for "FooTable" and if it doesn't exist it returns a
generic "Doctine_Table" class. This is good, as we need not flood the
directory with empty *Table files. But no good anymore in sf1.1
because if "FooTable" doesn't exist, symfony will autoload again!
As $freshCache will be set to false (sfAutoload.class.php:105) after
every reload, the more *Table you attempt to retrieve, the more class
reloading occrus. This results in terrible performance.
I now create *Table for every model to prevent re-autoloading.
But I think this is a problem need to be fixed, and of course I don't
want Doctrine to change its behavior to force a table class for every
model. Is there a way to fix this, or work around? For example, allow
developers to disable class reload in configuration?
> Today I started converting my project to symfony 1.1 in favor of the
> customization goodies (I need sfNoRouting) which drives me into speed
> nightmare. In dev environment, every request costs 15 seconds which is
> totally unacceptable.
> I found this is caused by the behavior of Doctrine library.
> When you execute "Doctrine::getTable('Foo');". Doctrine will first
> attempt to search for "FooTable" and if it doesn't exist it returns a
> generic "Doctine_Table" class. This is good, as we need not flood the
> directory with empty *Table files. But no good anymore in sf1.1
> because if "FooTable" doesn't exist, symfony will autoload again!
> As $freshCache will be set to false (sfAutoload.class.php:105) after
> every reload, the more *Table you attempt to retrieve, the more class
> reloading occrus. This results in terrible performance.
> I now create *Table for every model to prevent re-autoloading.
> But I think this is a problem need to be fixed, and of course I don't
> want Doctrine to change its behavior to force a table class for every
> model. Is there a way to fix this, or work around? For example, allow
> developers to disable class reload in configuration?
I was aware of this thread before I decided to raise the issue.
My impression was it's related to Doctrine loading a particular
"behavior", which was already fixed by symfony and Doctrine, but was
somewhat different from what I mean.
But now I found I overlooked that Fabian mentioned the repetitive
autoloading issue which is exactly what I'm talking about.
Anyway it still happens in the latest trunk due to the "$freshCache =
false" statement, possibly due to [9207], as
mentioned by Jonathan (http://groups.google.com/group/symfony-users/ browse_thread/thread/3a905ba0c63f8d74).
Even when it is fixed, it is not optimal because re-autoloading would
always occur once per request. Clearing cache and building autoloading
files can take several seconds on my slow development machine,
which is what I want to get rid of as I hate the need to wait during
development :P
Tamcy
On Jun 15, 6:40 am, "Romain Dorgueil (hartym)" <har...@dakrazy.net>
wrote: