This is a discussion on php object performance within the PHP Language forums, part of the PHP Programming Forums category; Hello there! I've tried to gather some infos about php object performance. I got started developing an app using ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello there! I've tried to gather some infos about php object performance. I got started developing an app using php object and have the worst requests time I ever seen. I mean, once all my classes uploaded on a host, I call index.php to get classes instanciations and it could take 55sec to generate the first response and about 1 or 2 sec for the following calls.. ...and I'm scared about those latencies.^^ I only have less than 10 classes with inheritance and some calls to SQL server but it sounds that I don't follow some basic rules.. ^^ Hm... how do I have to consider php object performance ? What searches have I to make ?? I'm getting lost.. I don't know what and where to look after.. ^^ any idea ? Thanks a lot :) |
|
|||
|
On Jun 28, 8:30 am, PaowZ <gpa...@gmail.com> wrote:
> Hello there! > > I've tried to gather some infos about php object performance. > I got started developing an app using php object and have the worst > requests time I ever seen. > I mean, once all my classes uploaded on a host, I call index.php to > get classes instanciations and it could take 55sec to generate the > first response and about 1 or 2 sec for the following calls.. > ..and I'm scared about those latencies.^^ > I only have less than 10 classes with inheritance and some calls to > SQL server but it sounds that I don't follow some basic rules.. ^^ > Hm... how do I have to consider php object performance ? What searches > have I to make ?? > I'm getting lost.. I don't know what and where to look after.. ^^ > > any idea ? > > Thanks a lot :) I highly doubt that "php objects" are to blame for your problems -- more likely something in the code itself. Even more likely something to do with the database. Get a profiler to figure out where the problem is, or place some strategic echo's throughout your code and run some timing tests. |
|
|||
|
On 28 juin, 14:42, ZeldorBlat <zeldorb...@gmail.com> wrote:
> On Jun 28, 8:30 am, PaowZ <gpa...@gmail.com> wrote: > > > > > > > Hello there! > > > I've tried to gather some infos about php object performance. > > I got started developing an app using php object and have the worst > > requests time I ever seen. > > I mean, once all my classes uploaded on a host, I call index.php to > > get classes instanciations and it could take 55sec to generate the > > first response and about 1 or 2 sec for the following calls.. > > ..and I'm scared about those latencies.^^ > > I only have less than 10 classes with inheritance and some calls to > > SQL server but it sounds that I don't follow some basic rules.. ^^ > > Hm... how do I have to consider php object performance ? What searches > > have I to make ?? > > I'm getting lost.. I don't know what and where to look after.. ^^ > > > any idea ? > > > Thanks a lot :) > > I highly doubt that "php objects" are to blame for your problems -- > more likely something in the code itself. Even more likely something > to do with the database. Get a profiler to figure out where the > problem is, or place some strategic echo's throughout your code and > run some timing tests.- Masquer le texte des messages précédents - > > - Afficher le texte des messages précédents - a profiler?? I've heard a little about it.. ok, I give a try.. and let you know, if necessary.. thanks ZeldorBlat |
|
|||
|
PaowZ wrote:
> I got started developing an app using php object and have the worst > requests time I ever seen. Are you using autoloading? -- Toby A Inkster BSc (Hons) ARCS [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux] [OS: Linux 2.6.12-12mdksmp, up 7 days, 18:22.] Long-Awaited Zeldman Article http://tobyinkster.co.uk/blog/2007/0...ldman-in-time/ |
|
|||
|
On 28 juin, 16:42, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote: > PaowZ wrote: > > I got started developing an app using php object and have the worst > > requests time I ever seen. > > Are you using autoloading? > > -- > Toby A Inkster BSc (Hons) ARCS > [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux] > [OS: Linux 2.6.12-12mdksmp, up 7 days, 18:22.] > > Long-Awaited Zeldman Article > http://tobyinkster.co.uk/blog/2007/0...ldman-in-time/ No, I gave up knowing that this magic function is costly.. I prefer require_once() the right class when needed.. :) |
|
|||
|
On Jun 28, 11:34 am, PaowZ <gpa...@gmail.com> wrote:
> On 28 juin, 16:42, Toby A Inkster <usenet200...@tobyinkster.co.uk> > wrote: > > > PaowZ wrote: > > > I got started developing an app using php object and have the worst > > > requests time I ever seen. > > > Are you using autoloading? > > > -- > > Toby A Inkster BSc (Hons) ARCS > > [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux] > > [OS: Linux 2.6.12-12mdksmp, up 7 days, 18:22.] > > > Long-Awaited Zeldman Article > > http://tobyinkster.co.uk/blog/2007/0...ldman-in-time/ > > No, I gave up knowing that this magic function is costly.. I prefer > require_once() the right class when needed.. :) How do you know it's costly? I've never had a problem with it... |
|
|||
|
On Thu, 28 Jun 2007 18:01:22 +0200, ZeldorBlat <zeldorblat@gmail.com>
wrote: > On Jun 28, 11:34 am, PaowZ <gpa...@gmail.com> wrote: >> On 28 juin, 16:42, Toby A Inkster <usenet200...@tobyinkster.co.uk> >> wrote: >> >> > PaowZ wrote: >> > > I got started developing an app using php object and have the worst >> > > requests time I ever seen. >> >> > Are you using autoloading? >> >> > -- >> > Toby A Inkster BSc (Hons) ARCS >> > [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux] >> > [OS: Linux 2.6.12-12mdksmp, up 7 days, 18:22.] >> >> > Long-Awaited Zeldman Article >> > http://tobyinkster.co.uk/blog/2007/0...ldman-in-time/ >> >> No, I gave up knowing that this magic function is costly.. I prefer >> require_once() the right class when needed.. :) > > How do you know it's costly? I've never had a problem with it... > Indeed, autoloading is not the same as preloading. It should have very little effect on resources. -- Rik Wasmus |
|
|||
|
On 28 juin, 18:08, Rik <luiheidsgoe...@hotmail.com> wrote:
> On Thu, 28 Jun 2007 18:01:22 +0200, ZeldorBlat <zeldorb...@gmail.com> > wrote: > > > > > > > On Jun 28, 11:34 am, PaowZ <gpa...@gmail.com> wrote: > >> On 28 juin, 16:42, Toby A Inkster <usenet200...@tobyinkster.co.uk> > >> wrote: > > >> > PaowZ wrote: > >> > > I got started developing an app using php object and have the worst > >> > > requests time I ever seen. > > >> > Are you using autoloading? > > >> > -- > >> > Toby A Inkster BSc (Hons) ARCS > >> > [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux] > >> > [OS: Linux 2.6.12-12mdksmp, up 7 days, 18:22.] > > >> > Long-Awaited Zeldman Article > >> > http://tobyinkster.co.uk/blog/2007/0...ldman-in-time/ > > >> No, I gave up knowing that this magic function is costly.. I prefer > >> require_once() the right class when needed.. :) > > > How do you know it's costly? I've never had a problem with it... > > Indeed, autoloading is not the same as preloading. It should have very > little effect on resources. > > -- > Rik Wasmus- Masquer le texte des messages précédents - > > - Afficher le texte des messages précédents - Really? actually, I read this hint on some websites.. that may be false, however :) well, concerning my issue. the following request: SELECT COUNT(*) AS nbre FROM information_schema.tables WHERE `table_type` = 'BASE TABLE' ...is responsible for such a latency. It uses predefined tables in mySQL engine... I switched to an other board (comp...mysql) to discuss it.. :) |
|
|||
|
On Jun 28, 12:25 pm, PaowZ <gpa...@gmail.com> wrote:
> On 28 juin, 18:08, Rik <luiheidsgoe...@hotmail.com> wrote: > > > > > On Thu, 28 Jun 2007 18:01:22 +0200, ZeldorBlat <zeldorb...@gmail.com> > > wrote: > > > > On Jun 28, 11:34 am, PaowZ <gpa...@gmail.com> wrote: > > >> On 28 juin, 16:42, Toby A Inkster <usenet200...@tobyinkster.co.uk> > > >> wrote: > > > >> > PaowZ wrote: > > >> > > I got started developing an app using php object and have the worst > > >> > > requests time I ever seen. > > > >> > Are you using autoloading? > > > >> > -- > > >> > Toby A Inkster BSc (Hons) ARCS > > >> > [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux] > > >> > [OS: Linux 2.6.12-12mdksmp, up 7 days, 18:22.] > > > >> > Long-Awaited Zeldman Article > > >> > http://tobyinkster.co.uk/blog/2007/0...ldman-in-time/ > > > >> No, I gave up knowing that this magic function is costly.. I prefer > > >> require_once() the right class when needed.. :) > > > > How do you know it's costly? I've never had a problem with it... > > > Indeed, autoloading is not the same as preloading. It should have very > > little effect on resources. > > > -- > > Rik Wasmus- Masquer le texte des messages précédents - > > > - Afficher le texte des messages précédents - > > Really? actually, I read this hint on some websites.. that may be > false, however :) > well, concerning my issue. the following request: > SELECT COUNT(*) AS nbre FROM information_schema.tables WHERE > `table_type` = 'BASE TABLE' > ..is responsible for such a latency. It uses predefined tables in > mySQL engine... I switched to an other board (comp...mysql) to discuss > it.. :) Don't trust everything the internet tells you. Try something first, then optimize if you run into problems. Often you'll find that the problem has little to do with what you thought it did and everything to do with what you didn't think it did (as this thread is evidence of). Google around for "Premature Optimization" and see what you can find. |
|
|||
|
On 28 juin, 19:03, ZeldorBlat <zeldorb...@gmail.com> wrote:
> On Jun 28, 12:25 pm, PaowZ <gpa...@gmail.com> wrote: > > > > > > > On 28 juin, 18:08, Rik <luiheidsgoe...@hotmail.com> wrote: > > > > On Thu, 28 Jun 2007 18:01:22 +0200, ZeldorBlat <zeldorb...@gmail.com> > > > wrote: > > > > > On Jun 28, 11:34 am, PaowZ <gpa...@gmail.com> wrote: > > > >> On 28 juin, 16:42, Toby A Inkster <usenet200...@tobyinkster.co.uk> > > > >> wrote: > > > > >> > PaowZ wrote: > > > >> > > I got started developing an app using php object and have the worst > > > >> > > requests time I ever seen. > > > > >> > Are you using autoloading? > > > > >> > -- > > > >> > Toby A Inkster BSc (Hons) ARCS > > > >> > [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux] > > > >> > [OS: Linux 2.6.12-12mdksmp, up 7 days, 18:22.] > > > > >> > Long-Awaited Zeldman Article > > > >> > http://tobyinkster.co.uk/blog/2007/0...ldman-in-time/ > > > > >> No, I gave up knowing that this magic function is costly.. I prefer > > > >> require_once() the right class when needed.. :) > > > > > How do you know it's costly? I've never had a problem with it... > > > > Indeed, autoloading is not the same as preloading. It should have very > > > little effect on resources. > > > > -- > > > Rik Wasmus- Masquer le texte des messages précédents - > > > > - Afficher le texte des messages précédents - > > > Really? actually, I read this hint on some websites.. that may be > > false, however :) > > well, concerning my issue. the following request: > > SELECT COUNT(*) AS nbre FROM information_schema.tables WHERE > > `table_type` = 'BASE TABLE' > > ..is responsible for such a latency. It uses predefined tables in > > mySQL engine... I switched to an other board (comp...mysql) to discuss > > it.. :) > > Don't trust everything the internet tells you. Sure :).. usually, I run into empirical tests before taking any decisions. And I am aware that premature optimization could lead into troubles.. but how to start optimizing after conception without having to remove/modify essential pieces of code due to optimizations ? I think this is a debate that deserves its own thread, I'm off topic :). Interesting debate, though. > Google around for "Premature Optimization" and see what you can find. I'll have a look :) Thanks ZeldorBlat. |