hitting the limits

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

    #16
    Re: hitting the limits

    Jerry Stuckle wrote:[color=blue]
    > windandwaves wrote:[color=green]
    >> Jerry Stuckle wrote:
    >> ....
    >>[color=darkred]
    >>> Why even us it? I find very seldom do I need it. And it does add
    >>> overhead.[/color]
    >>
    >>
    >> I use it on all my sites because in that way, I can perfectly indent
    >> my code but take out the 100s or even 1000s of spaces/tabs.
    >>
    >> For all my sites, I make a login and when the person is logged in
    >> (i.e. me the administrator), the page is produced with spaces so
    >> that I can analyse the code.
    >>
    >> I like writing xhtml strict with real simple xhtml that is
    >> compressed (i.e. without spaces) so that the actual pages are super
    >> small. I do this to protest against the dreamweavers out there, who
    >> create html that is often over 100kb and just pollutes the
    >> superhighway with endless &nbsp; <td><img src="spacer.gif ">etc......
    >>
    >> HTMS
    >>
    >>[color=darkred]
    >>> Nicolaas[/color]
    >>
    >>
    >>[/color]
    >
    > You can write perfectly good xml or html without obstart(). The two
    > have nothing to do with each other.
    >
    > But compressing a page then expanding it just to make the code more
    > readable doesn't make sense. Just expand it in the file and serve it
    > statically. There's much less overhead.[/color]

    What I do is for any user that is not logged-in, I compress the page getting
    rid of the 1000s of spaces and tabs. For the select few that log-in, I do
    not compress it so I can quickly spot errors in the code.
    [color=blue]
    > I think the only time I've really needed obstart() is when I wanted
    > to wrap phpinfo() in another page. In that case I needed to get the
    > output, parse it, getting rid of the extra tags, then print it.[/color]

    I just like ditching all the html at once. Bang, 3Kb of perfectly clean
    (x)html. The css, javascript and images are bulkier, but these are often
    cached. Hmmm, you are probably right though, I would involved a LOT of
    changes :-)


    Comment

    • windandwaves

      #17
      Re: hitting the limits

      Rik wrote:[color=blue]
      > windandwaves wrote:[color=green]
      >> It is so hard for me to judge if the code is efficient. Really - who
      >> knows. I know what efficient code is, but there are just so many
      >> variables. Even making changes tot the php.ini could be huge.[/color]
      >
      > Yup, but previous suggestion with microtime() would give you an
      > indication where the most time is taken.[/color]

      Yes, I may try that, but i found that pages load superfast one second and
      almost not at all the next. I did some database work last night with a
      script running through an entire table of 20,000 records one by one. I did
      an echo for each line and it was really interesting to see that sometimes
      the entire screen filled with echos within a split second, while the next
      moment, each line would literally take one second.
      [color=blue]
      >[color=green]
      >> Each page loads about 100Kb of libaries and functions... (probably 50
      >> - 100 functions (small ones) in total)... Does that make a
      >> difference?[/color]
      >
      > Yes, probably not a lot, but why?
      > I'm having great difficulties imagining a a website where that much
      > libraries and functions are needed. Maybe it's time to include only
      > files that are actually needed?[/color]

      Yes, that is for sure, but sorting out exactly what is needed for each page
      take expensive development time.
      [color=blue]
      >
      > It may be worth it to check the following url:
      > http://nl2.php.net/manual/en/language.oop5.autoload.php
      >[color=green]
      >> I have a couple of tables in the database with over 300,000 (small)
      >> rows)... Does that make a difference?[/color]
      >
      > Having a database doesn't make a differnce.
      > Exactly HOW you query the database does.[/color]

      Lol, yes, I guess you are right. I have added lots of indexes so querying
      should be pretty fast, but adding may take longer....

      I have one unique index that compromises five fields, would that matter?

      So many questions, so few clues
      [color=blue]
      > Normalize and create proper indexes.-
      >
      > Grtz,[/color]


      Comment

      • Jerry Stuckle

        #18
        Re: hitting the limits

        windandwaves wrote:[color=blue]
        > Jerry Stuckle wrote:
        >[color=green]
        >>windandwave s wrote:
        >>[color=darkred]
        >>>Jerry Stuckle wrote:
        >>>....
        >>>
        >>>
        >>>>Why even us it? I find very seldom do I need it. And it does add
        >>>>overhead.
        >>>
        >>>
        >>>I use it on all my sites because in that way, I can perfectly indent
        >>>my code but take out the 100s or even 1000s of spaces/tabs.
        >>>
        >>>For all my sites, I make a login and when the person is logged in
        >>>(i.e. me the administrator), the page is produced with spaces so
        >>>that I can analyse the code.
        >>>
        >>>I like writing xhtml strict with real simple xhtml that is
        >>>compressed (i.e. without spaces) so that the actual pages are super
        >>>small. I do this to protest against the dreamweavers out there, who
        >>>create html that is often over 100kb and just pollutes the
        >>>superhighw ay with endless &nbsp; <td><img src="spacer.gif ">etc......
        >>>
        >>>HTMS
        >>>
        >>>
        >>>
        >>>>Nicolaas
        >>>
        >>>
        >>>[/color]
        >>You can write perfectly good xml or html without obstart(). The two
        >>have nothing to do with each other.
        >>
        >>But compressing a page then expanding it just to make the code more
        >>readable doesn't make sense. Just expand it in the file and serve it
        >>statically. There's much less overhead.[/color]
        >
        >
        > What I do is for any user that is not logged-in, I compress the page getting
        > rid of the 1000s of spaces and tabs. For the select few that log-in, I do
        > not compress it so I can quickly spot errors in the code.
        >
        >[color=green]
        >>I think the only time I've really needed obstart() is when I wanted
        >>to wrap phpinfo() in another page. In that case I needed to get the
        >>output, parse it, getting rid of the extra tags, then print it.[/color]
        >
        >
        > I just like ditching all the html at once. Bang, 3Kb of perfectly clean
        > (x)html. The css, javascript and images are bulkier, but these are often
        > cached. Hmmm, you are probably right though, I would involved a LOT of
        > changes :-)
        >
        >[/color]

        And what happens if you have a problem with your compression?

        I'm now beginning to see why your provider is suspecting your scripts are a
        problem.

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • windandwaves

          #19
          Re: hitting the limits

          Jerry Stuckle wrote:
          ....snip....[color=blue]
          > And what happens if you have a problem with your compression?
          >
          > I'm now beginning to see why your provider is suspecting your scripts
          > are a problem.[/color]

          when I say compression, I just mean taking out the extra spaces, nothing
          else. that is all I do. I load all the script outputs to the buffer and
          then remove any double spaces and tabs. The funny thing is that in the last
          day, the server runs a lot, lot faster.... With the same amount of visitors.
          I am still


          Comment

          • Jeff North

            #20
            Re: hitting the limits

            On Sun, 30 Apr 2006 13:44:43 +1200, in comp.lang.php "windandwav es"
            <winandwaves@co ldmail.com>
            <uEU4g.6659$0Y5 .5349@news.xtra .co.nz> wrote:
            [color=blue]
            >| Rik wrote:
            >| > windandwaves wrote:
            >| >> It is so hard for me to judge if the code is efficient. Really - who
            >| >> knows. I know what efficient code is, but there are just so many
            >| >> variables. Even making changes tot the php.ini could be huge.
            >| >
            >| > Yup, but previous suggestion with microtime() would give you an
            >| > indication where the most time is taken.
            >|
            >| Yes, I may try that, but i found that pages load superfast one second and
            >| almost not at all the next. I did some database work last night with a
            >| script running through an entire table of 20,000 records one by one. I did
            >| an echo for each line and it was really interesting to see that sometimes
            >| the entire screen filled with echos within a split second, while the next
            >| moment, each line would literally take one second.[/color]

            When was the last time you 'defragged' your tables?
            Optimize table <tablename>
            Repair table <tablename> EXTENDED USE_FRM
            ---------------------------------------------------------------
            I often wish that email had never been invented, but there’s
            just no way I can get rid of it. So, day after day, several times
            a day, I dutifully delete 99% of the emails I receive, and when
            I’m not able to get at my email for a few days, I’ll leave the
            machine at home running to pick it up every 10 minutes so I don’t
            overflow some capacity somewhere, and just the other day I caught
            myself wondering who will clean out my Inbox after I’m dead.

            Charles Petzold. October 20, 2005
            ---------------------------------------------------------------

            Comment

            Working...