php object performance

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PaowZ

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

  • ZeldorBlat

    #2
    Re: php object performance

    On Jun 28, 8:30 am, PaowZ <gpa...@gmail.c omwrote:
    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.

    Comment

    • PaowZ

      #3
      Re: php object performance

      On 28 juin, 14:42, ZeldorBlat <zeldorb...@gma il.comwrote:
      On Jun 28, 8:30 am, PaowZ <gpa...@gmail.c omwrote:
      >
      >
      >
      >
      >
      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

      Comment

      • Toby A Inkster

        #4
        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

        Comment

        • PaowZ

          #5
          Re: php object performance

          On 28 juin, 16:42, Toby A Inkster <usenet200...@t obyinkster.co.u k>
          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.. :)


          Comment

          • ZeldorBlat

            #6
            Re: php object performance

            On Jun 28, 11:34 am, PaowZ <gpa...@gmail.c omwrote:
            On 28 juin, 16:42, Toby A Inkster <usenet200...@t obyinkster.co.u k>
            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.]
            >>
            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...

            Comment

            • Rik

              #7
              Re: php object performance

              On Thu, 28 Jun 2007 18:01:22 +0200, ZeldorBlat <zeldorblat@gma il.com>
              wrote:
              On Jun 28, 11:34 am, PaowZ <gpa...@gmail.c omwrote:
              >On 28 juin, 16:42, Toby A Inkster <usenet200...@t obyinkster.co.u k>
              >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.]
              >>>>
              >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

              Comment

              • PaowZ

                #8
                Re: php object performance

                On 28 juin, 18:08, Rik <luiheidsgoe... @hotmail.comwro te:
                On Thu, 28 Jun 2007 18:01:22 +0200, ZeldorBlat <zeldorb...@gma il.com
                wrote:
                >
                >
                >
                >
                >
                On Jun 28, 11:34 am, PaowZ <gpa...@gmail.c omwrote:
                On 28 juin, 16:42, Toby A Inkster <usenet200...@t obyinkster.co.u k>
                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.]
                >>
                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_sch ema.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.. :)

                Comment

                • ZeldorBlat

                  #9
                  Re: php object performance

                  On Jun 28, 12:25 pm, PaowZ <gpa...@gmail.c omwrote:
                  On 28 juin, 18:08, Rik <luiheidsgoe... @hotmail.comwro te:
                  >
                  >
                  >
                  On Thu, 28 Jun 2007 18:01:22 +0200, ZeldorBlat <zeldorb...@gma il.com>
                  wrote:
                  >
                  On Jun 28, 11:34 am, PaowZ <gpa...@gmail.c omwrote:
                  >On 28 juin, 16:42, Toby A Inkster <usenet200...@t obyinkster.co.u k>
                  >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.]
                  >>
                  >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_sch ema.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.

                  Comment

                  • PaowZ

                    #10
                    Re: php object performance

                    On 28 juin, 19:03, ZeldorBlat <zeldorb...@gma il.comwrote:
                    On Jun 28, 12:25 pm, PaowZ <gpa...@gmail.c omwrote:
                    >
                    >
                    >
                    >
                    >
                    On 28 juin, 18:08, Rik <luiheidsgoe... @hotmail.comwro te:
                    >
                    On Thu, 28 Jun 2007 18:01:22 +0200, ZeldorBlat <zeldorb...@gma il.com>
                    wrote:
                    >
                    On Jun 28, 11:34 am, PaowZ <gpa...@gmail.c omwrote:
                    On 28 juin, 16:42, Toby A Inkster <usenet200...@t obyinkster.co.u k>
                    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.]
                    >>
                    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_sch ema.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.


                    Comment

                    Working...