SitePoint Sponsor

User Tag List

Page 6 of 6 FirstFirst ... 23456
Results 126 to 130 of 130
  1. #126
    SitePoint Wizard
    Join Date
    Oct 2005
    Posts
    1,832
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by samanime View Post
    Actually, I just realized, how did we get off on this tangent of file access times? =p

    The original topic was on whether comments greatly affect execution time of a given file. I guess it does factor in if you're worrying about if comments need to be reprocessed on each include or not, but even in that case, file access is a moot point as it'd be (roughly) the same anyways.

    =p
    File access is going to be a bigger factor in execution time than the amount of comments. If you want to talk execution time, file access should be the biggest part of the discussion.

    Since Google announced that site speed would be a factor in its ranking algorithm, performance is now a part of SEO, at least for Google. Load speed is now more important than ever.

    Official Google Webmaster Central Blog: Using site speed in web search ranking

    Anything that can be reasonably done to reduce load speed should be done. This includes reducing the number of file access required by limiting the number of files included. It's a no-brainer to me. But apparently not to the developers of Wordpress.

    Quote Originally Posted by Lemon Juice View Post
    - not to make too many file accessess, I'm not paranoid but more than 100 would be too much in my opinion
    More than 10 would be getting to be too much for me.

  2. #127
    SitePoint Wizard TheRedDevil's Avatar
    Join Date
    Sep 2004
    Location
    Norway
    Posts
    1,196
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by deathshadow60 View Post
    Now on that we can agree... turdpress is an unmitigated disaster under the hood; it's up to what? 400+ separate .php files when overall it has maybe 30 actual operations it performs? IF THAT? In a lot of ways you poke your head into the code, and it's like the people writing WP are deathly afraid of functions AND objects; almost more like a giant old-fashioned batch file or basic program written without even using GoSub. Actually, no, it's more like the old CHAIN command used in 8 and 16 bit memory spaces to let one program halt itself, unload it's code from memory while leaving it's variable data intact to load and run some other code.
    You wont find many good open source projects in PHP, nor paid for that matter.

    The problem with the language is basically, "it is very simple to learn and difficult to master".

    Not to mention, most of the books teaching PHP is a joke (and tutorials for that matter). The one SitePoint promotes is a good example of that.

    Hence we get lots of people who read a book or a tutorial and start advertising their service as a web developer.

    To become a good programer you will also need a knowledge and understanding of the hardware that will be running on the server/computer your programming for, for web programming you will need to at least have a knowledge on how the Hypertext Transfer Protocol works.

    On top of this you have virtual security, proper use of OOP (i.e. not wrapping procedual code in classes and calling it OOP).

    Personally I believe this is something that will just keep getting worse, as the more people that come online from lower cost countries, the more so called web developers will offer their services.

    Though with that said, I dont believe this is just a PHP issue, Ive seen my share of horrible C, C++, C#, Java etc programmers as well.

    Quote Originally Posted by paul_wilkins View Post
    One of the few beneficial uses of using an explicitly stated true condition, is when you need to perform one-and-a-half loops:

    Code javascript:
    while (TRUE) {
        $row = mysql_fetch_assoc($result);
        if ($row === FALSE) {
            break;
        }
        ...
    }

    However, the following can be more understandable, even though linting programs can dislike it:

    Code javascript:
    while ($row = mysql_fetch_assoc($result)) {
        ...
    }
    You do understand that both of those examples does exactly the same? In addition the second option would be the best choice to use in PHP.
    If you want a loop that run at least once, use do {} while ();

    Quote Originally Posted by deathshadow60 View Post
    Actually I find spaces around operators LESS clear because it then looks like a bunch of different operations instead of one... to me spaces are for around binary operators (and,or,xor,not) and not mathematical /syntatic/comparison ones. Basically I find:

    $x=$x+1; clearer than $x = $x + 1;

    Maybe it's just because symbols stand out like a sore thumb next to alpha for me -- maybe because I never saw ANYONE format code with all those extra spaces until about seven years ago... (which after 33 years of programming...)
    Personally I prefer $x = $x + 1;, though I dont like when someone space out everything of their code out like that.

    Example:
    if ( $true === true )
    echo 'this is ' . $a . ' string that is ' . $concatenated . '.';
    for ( $num = 0 ; $num < $total ; ++$num )

    Seeing code like that makes me feel bad inside.

    Quote Originally Posted by deathshadow60 View Post
    See why I like 1TBS over Allman -- I like my close to line up with the statement being closed, not just the opening bracket.
    I actually prefer a mix of 1TBS and Whitesmiths. Where the start is like 1TBS and content/end is like Whitesmiths.

    You would probably have a fit if you checked out our company coding standards, as it is a mix of a lot of different methods and naming standards. The key point when we decided on it, was that it should make the code very easy to read/understand if you came back after a few years without working on it (i.e. by one glance you should understand where variables come from and what the code does). In the end this is what matters in my opinion, as in the long run having easy to read code saves time.

    Quote Originally Posted by cheesedude View Post
    File access is going to be a bigger factor in execution time than the amount of comments. If you want to talk execution time, file access should be the biggest part of the discussion.

    More than 10 would be getting to be too much for me.
    The number of files included will also depend on the size of the project your working on. The larger the project, the more files you will have.

    DISK I/O
    There is a lot of claims about disk I/O issues in this thread, though from the look of it, the people complaining about it does not know that much about the subject.

    First, Disk I/O is NOT a problem for web development. So instead of worrying about it, read up on how to solve it.

    Even if your a web developer it is good to have a basic knowledge about server management, and what options you have. Or at least have a good server technician on the team that can handle this.

    I will not get into details of the different raid options, options as scsi, sas, ssd nor vertical or horizontal scaling. Lets instead focus on the simple things that you can do to any server.

    As already mentioned you have software that cache the bytecode like APC, Zend Server. Of course its a good idea to install this on the server as soon as possible. In addition to this you can setup a ramdisk for the application files required by the website.

    With those two in place, you will never face Disk I/O issues again due to included files in your PHP application...

    Considering how cheap ram is these days and the fact that even the cheap server motherboards support up to at least 32GB with ram, you can put a lot of the often accessed content on a ramdisk.

    By doing this simple step, Ive several times taken the server load on new customers servers down from a a constant 5+ load to a low 0.X load.

    Though as the traffic increases to your website increases, you would need to consider more advanced options on top of this. Though, for over 95% of the websites that is on the internet, the above solution will be good enough.


    Before someone comes here and says they cant do this as they are on a shared hosting account. Well... If you can not afford at least a VPS, then you should perhaps consider shutting down the website, as its obviously does not have the right of life.

    If a company can not afford a small dedicated server or a VPS, for a website that is receiving the amount of traffic that would make it slow on a shared hosting account, then they would need to reevaluate their entire business strategy, as they are obviously doing something wrong.

    My personal opinion is that shared hosting is for private use, not for businesses. Any business should be able to fork out $60 for at least a VPS per month.

    TESTING DISK I/O
    You can just as well drop this, as the result will not be accurate, there is too many factors involved. Even if all of those are considered, the statistics will still only be valid in the specific enviroment the tests was run in.

    The problem with testing is that you have the factor of unknown, the only way to not have this play a role in the results is if you have a identical enviroment for every test. And unless you have a own computer setup for this specific testing, where all non-needed systems has been turned off. Then the tests will all get a different amount of CPU time all depending what applications that demand resources while the tests are run.

    Setting up a Virtual Enviroment will only help to a degree, as it will still require resources from the host computer. So again the host will play a big role in the amount or resources the test receives.

    In addition it is also important to remember the different levels of caching that you have in this process. You can have it on a software level (depending on the application), it will be on a OS level and on the actual hdd (every hdd today has both write and read cache). Some hdds even have algorithms that know which files to load to chache depending what file you pulled last.

    On top of this you have the sector size, the stripe size (raid) and so on. Not to mention that different OS and HDDs has different ways of handling the cache, and the size of it.

    In the end this makes out for a lot of variables in the test. Sure you can disable the cache on every level, but that would not make for a relevant test (i.e. it would be a isolated case, not equal to a real world case).

    Considering the big picture, I dont think I would worry about running a test like this as it is a non-relevant problem that is easily fixed by some server management.

  3. #128
    SitePoint Guru bronze trophy
    Join Date
    Dec 2003
    Location
    Poland
    Posts
    930
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TheRedDevil View Post
    My personal opinion is that shared hosting is for private use, not for businesses. Any business should be able to fork out $60 for at least a VPS per month.
    You've gone too far with this kind of thinking. There are many businesses that use shared hosting and in some countries a large majority of businesses do that and I think it's good. Whether you are a business or not doesn't matter, what matters is the specific server requirements that are needed. If a business needs a simple web site to promote their services it's a waste of money to buy a VPS. Also, many online shops work pretty well on shared hosting. Your idea only promotes waste of money and resources. It's as if you said that any employee in a business should be given a car. If there is need - you get it, if not then you don't. Simple.

  4. #129
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    4,995
    Mentioned
    100 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TheRedDevil View Post
    Not to mention, most of the books teaching PHP is a joke (and tutorials for that matter). The one SitePoint promotes is a good example of that.
    Are you refering to the "Build Your Own Database Driven Website" book or the "PHP Anthology" book (and which version of the book)? In what ways do you consider it to be a "joke"?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  5. #130
    SitePoint Zealot Dorsey's Avatar
    Join Date
    Feb 2004
    Location
    NJ
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can either side produce metrics to support their case? We may be talking about a distinction without any difference.


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
  •