php object performance

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-28-2007
PaowZ
 
Posts: n/a
Default php object performance


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 :)

Reply With Quote
  #2 (permalink)  
Old 06-28-2007
ZeldorBlat
 
Posts: n/a
Default Re: php object performance

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.

Reply With Quote
  #3 (permalink)  
Old 06-28-2007
PaowZ
 
Posts: n/a
Default Re: php object performance

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

Reply With Quote
  #4 (permalink)  
Old 06-28-2007
Toby A Inkster
 
Posts: n/a
Default Re: php object performance

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/
Reply With Quote
  #5 (permalink)  
Old 06-28-2007
PaowZ
 
Posts: n/a
Default Re: php object performance

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.. :)


Reply With Quote
  #6 (permalink)  
Old 06-28-2007
ZeldorBlat
 
Posts: n/a
Default Re: php object performance

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...

Reply With Quote
  #7 (permalink)  
Old 06-28-2007
Rik
 
Posts: n/a
Default Re: php object performance

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
Reply With Quote
  #8 (permalink)  
Old 06-28-2007
PaowZ
 
Posts: n/a
Default Re: php object performance

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.. :)

Reply With Quote
  #9 (permalink)  
Old 06-28-2007
ZeldorBlat
 
Posts: n/a
Default Re: php object performance

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.

Reply With Quote
  #10 (permalink)  
Old 06-28-2007
PaowZ
 
Posts: n/a
Default Re: php object performance

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.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:07 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0