SitePoint Sponsor

User Tag List

Page 3 of 3 FirstFirst 123
Results 51 to 61 of 61
  1. #51
    SitePoint Member
    Join Date
    Jun 2004
    Location
    Canada
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your "percentage" is bogus. A one miliseconds worth of code that has a 100% improvement is now half a milisecond. A DB query will take 20-50 miliseconds even on localhost. [...]
    We frequently make 3-4000 page fetches a minute from a single spider running on a single server.
    So you would work on the 20-50ms DB query because that is worth it. In my original post I talk about 0.04ms and 0.06ms but let's get smaller: 0.02ms. At 2500 calls to your script that is 50ms. That is one DB query for free. Without doing any PP messy stuff, without spending days rewriting your SQL statements - just entering the best written code from the start. I mean - it's free. You don't have to do anything special for it.

    Typing 'this text' from the start can't be slower than typing "this text" from the start.

    Maybe I'm just so far out of my league here that I make consistent misuse of the word optimisation, suggesting doing all this stuff afterwards as a way to optimise slow code. Certainly not. If my script runs slow I would not for one ms (*grin*) think it is a ' vs. " issue :-)

    Oh btw Marcus, no offense was taken at your comments.

    Ruud

  2. #52
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Java is way fast enough, even on my mobile phone. You wouldn't want to go the J2EE route unless you have a specific scaling need for it though. As one of the most successful development languages of all time...well let's just hope it works out for them soon .
    Whoa, what kind of cell phone do you have? It's HORRENOUS on my Samsung A800. It's okay on my Sony Ericsson P800, but there is still a very clear difference between Java and C++ apps on it.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  3. #53
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have spent ten of my last twelve months doing almost nothing but optimisation. We now routinely do fuzzy full text searches on 10gig data sets in two seconds or less. We frequently make 3-4000 page fetches a minute from a single spider running on a single server. How?
    hmmm I would have simply thrown a few extra servers at it .. I got that gem of advice in a forum somewhere ...

    I don't understand you Marcus.

    A simple question of code optimization.

    There are some simple pointers that we have all learnt either by "do(ing) the ROI calculation " with our script-kiddie timers or from our peers (which is why people ask questions here (its a help forum)) and end up with some simple pointers , a knowledge that we can use in the future so we don't need do get out our script-kiddie timers or profilers.

    The quoting of SQL , post/pre increment are pure examples , you cant see that ? or you simply not looking ?

  4. #54
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ruud
    just entering the best written code from the start. I mean - it's free. You don't have to do anything special for it.
    Ruud gets the prize !

  5. #55
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by firepages
    "what would you think about knocking off the door handles to reduce drag and thus make the car go faster?"

    Perhaps if Jensen Button had done that to his BAR on Sunday he would have done better...
    I wasn't aware of that his car has door handles.
    Perhaps he should have switched to a realy Formula1 car then
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.

  6. #56
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    1) Script kiddie learns PHP.
    2) Script kiddie gets blog.
    3) Script kiddie learns to use a profiler (wow).
    4) Script kiddie measures a couple of isolated functions in a loop.
    5) Script kiddie posts "article" with lot's of scientific looking tables.
    Script kiddies are switching to Flash sooner or later, usually sooner
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.

  7. #57
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ruud
    just entering the best written code from the start. I mean - it's free. You don't have to do anything special for it.
    That's correct - but one only has to know it.
    At least to me it happens once in a while by looking through older sources that i some routines could have been done in a more efficiant way.
    And that's although i tried (at that time) to write it as good as i know.

    But as i said at the very beginning of this thread, avoiding the most obvious and well known pitfalls already helps alot.
    IMHO biggest problem is that people don't think long enough about their project.
    Just a good database (table-) structure takes about 2/3 to 3/4 of the whole development time of the project.
    Next item is displaying graphics. How much code optimization do you have to do just to save 1 second?
    Choosing the right picture format and resolution, optimize/pack it etc and one second saved is the pure minimum.

    Queries, graphics and loops - those are the main places to really think what and especially how to do - there are the hidden time savers (or killers).

    But people want to see results and start hacking. And that's where the mess (unefficient code) starts.
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.

  8. #58
    SitePoint Zealot
    Join Date
    Dec 2003
    Location
    with my kids
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yet Another Optimization Article
    Martin Fowler
    http://www.martinfowler.com/ieeeSoft...timization.pdf
    First, performance matters.
    ....
    The question is, “How do we achieve a fast program?”
    ....
    you have to actually run the code and measure performance.
    ...
    First, you need a profiler—a program that can analyze how much time your program spends in its various parts....You have to use a profiler.
    ....
    All of this reinforces the key rule that first you need to make you program clear, well factored, and nicely modular. Only when you’ve done
    that should you optimize.
    ....
    In the end, however, performance is not an absolute. Getting a program to run faster costs money, and it’s a business decision whether to invest in a quicker program.

  9. #59
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by firepages
    hmmm I would have simply thrown a few extra servers at it .. I got that gem of advice in a forum somewhere ...
    We are up to 11 already, as well as having the Zend accel. It's that trade off thing again. Even I cannot compete with the running cost of that lot .

    Quote Originally Posted by firepages
    I don't understand you Marcus.
    I have a habit of posting at some ridiculous time in the morning and this means I write a lot of gibberish. I certainly didn't want to imply you, or other protagonists on the thread, were a script kiddie in any way at all. I just did a Google for PHP optimisation to find out what was around and all I got was twiddling articles and got frustrated. I'll happily pull the post if it offended.

    Quote Originally Posted by firepages
    The quoting of SQL , post/pre increment are pure examples , you cant see that ? or you simply not looking ?
    No, I can (honestly). It was a convenient example to run with, but I mean why bother? Just write the code choosing your quoting for clarity. Developer cost swamps most code level optimisations. What I am saying is keep it clear, then measure and then think big when you hit problems. Need to optimise a loop? Remove the loop.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  10. #60
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by M. Johansson
    Whoa, what kind of cell phone do you have? It's HORRENOUS on my Samsung A800. It's okay on my Sony Ericsson P800, but there is still a very clear difference between Java and C++ apps on it.
    Well, you out do me either way . I have a Nokia 9210 and play the silly football game and read RSS feeds.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  11. #61
    Non-Member
    Join Date
    Jan 2004
    Location
    Planet Earth
    Posts
    1,764
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:


    Whoa, what kind of cell phone do you have?


    Motorola V300 Was after the V600 (bluetooth) but the shop didn't have any left


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •