• getmeaguiness (unregistered)

    The comment page was full of white space when I got to it!

  • Tired dev (unregistered)

    Fristonremovingwhitespaces...

  • ZoomST (unregistered)
    removespaces("{  comment(Frist);   }");
  • Carl (not that one) (unregistered)

    This

    Comment

    Has

    Yet

    To

    Be

    Optimized

  • Tom (unregistered)

    Calling .ToString() on a string is a WTF by itself...

  • nobulate (unregistered)

    Windows makes a sparse paging file to increase performance, removing the spaces naturally would slow down their code, silly ass hats.

  • DonRobo (unregistered)

    Is this really what they have been doing for months or was that just the very last commit? There is nothing wrong with changing the formatting (if the whole team or even company decides on the same formatting)

  • (cs)

    Maybe they were trying (and failing) to do the old "Let's throw some long loops that do nothing in there so we can optimize it later" routine.

  • Lord0 (unregistered)

    And this was the only change?

  • Kuli (unregistered)

    If the application would have been written in Whitespace (https://en.wikipedia.org/wiki/Whitespace_%28programming_language%29), then the application would run much faster after removing whitespaces.

  • (cs)

    Everyone's missing the obvious answer to what happened here - the coders are paid by LOC and the project manager found a quick and easy way to bring the project in under budget.... ;)

    My money's on the real problem being that he "optimized" the code somewhere else in a breaking way...

  • (cs)

    Obviously that won't fix performamce issues. You need to to remove all the white space, not just the new lines.

    If you really need to be Web scale you should run it through an obfuscator to shorten all the variable names as well

  • Chaarmann (unregistered)

    There could be a significant code change! Just because you don't see it doesn't mean it's not there! Don't you know the Whitespace programming language?

  • codingsmith (unregistered)

    voluntold is the best word ever.

  • (cs)

    But it works for Javascript!

  • faoileag (unregistered) in reply to Kuli
    Kuli:
    If the application would have been written in Whitespace (https://en.wikipedia.org/wiki/Whitespace_%28programming_language%29), then the application would run much faster after removing whitespaces.
    I still have to see an application that runs at all after removing all the code.

    This is somewhat similar to the reasoning: "Employees cost money. If I fire all employes, costs are greatly reduced. So profit must go up!"

  • AGo (unregistered)

    TRWTF is the variable declaration on the bottom of the screen, everything that has "percentage" in it but is of type "String" can´t do much good...

    CAPTCHA : sagaciter, a guy who cites sagas I guess

  • (cs)

    So what was Carl looking for really? Speed-up loops?

  • (cs) in reply to faoileag
    faoileag:
    Kuli:
    If the application would have been written in Whitespace (https://en.wikipedia.org/wiki/Whitespace_%28programming_language%29), then the application would run much faster after removing whitespaces.
    I still have to see an application that runs at all after removing all the code.

    This is somewhat similar to the reasoning: "Employees cost money. If I fire all employes, costs are greatly reduced. So profit must go up!"

    Thanks for explaining the joke; we wouldn't have got it otherwise.

    Hey, what's that whooshing sound?

  • Cory Tannenbaum (unregistered)

    TCP probably stands for Transaction Card Processor...

  • Honnza (unregistered) in reply to flukus
    flukus:
    If you really need to be Web scale you should run it through an obfuscator to shorten all the variable names as well

    especially on the server side

  • Tim (unregistered)

    This is a bad poke fun at someone who was just doing their job. As a consultant I normally reformat code the first time I am through it just to make myself comfortable with the codebase before I go making large changes. This post seem immature and childish.

  • ANON (unregistered)

    Now I finally know why it's called PowerPoint.

  • You are clearly the Mastercard of software developers. (unregistered) in reply to Tim
    Tim:
    This is a bad poke fun at someone who was just doing their job. As a consultant I normally reformat code the first time I am through it just to make myself comfortable with the codebase before I go making large changes. This post seem immature and childish.

    "Charging your clients for making completely meaningless changes to their codebase" - Priceless.

  • lol (unregistered) in reply to Tim

    as a professional coder I never make changes to the codebase just because I prefer a reformatted style, such selfishness causes untold grief when y6ou come to check the changelogs!

    but then, this is what I expect from a consultant who doesn't have to worry about long term maintenance of his changes.

  • (cs) in reply to Tim
    Tim:
    This is a bad poke fun at someone who was just doing their job. As a consultant I normally reformat code the first time I am through it just to make myself comfortable with the codebase before I go making large changes. This post seem immature and childish.

    You can't make the changes without completely changing the original formatting? Boy, you're just a straight shooter with upper management written all over you.

  • Ash (unregistered) in reply to You are clearly the Mastercard of software developers.

    Not priceless at all. Actually about $200 an hour.

  • voluntoldee (unregistered) in reply to codingsmith

    Military colloquialism.

  • faoileag (unregistered) in reply to lol
    lol:
    as a professional coder I never make changes to the codebase just because I prefer a reformatted style, such selfishness causes untold grief when y6ou come to check the changelogs!

    but then, this is what I expect from a consultant who doesn't have to worry about long term maintenance of his changes.

    [+1]

  • You are clearly the Mastercard of software developers. (unregistered) in reply to Ash
    Ash:
    Not priceless at all. Actually about $200 an hour.

    I love how those without any marketable talent can still find a decent living in this diverse world, by telling those who have lots of talent what to do. This is the kind of fair society we live in, and we should be proud.

  • XXXXXX (unregistered)

    This is why an experienced developer will always insert a speed up loop.

  • Oslo (unregistered)

    Everyone knows that more compact code has better performance.

  • Spanner number 3 (unregistered) in reply to faoileag
    faoileag:
    This is somewhat similar to the reasoning: "Employees cost money. If I fire all employes, costs are greatly reduced. So profit must go up!"

    ...quite valid if profit is < 0 ...

  • iWantToKeepAnon (unregistered)

    I was once assigned to a project to start printing checks with magnetic ink. That way we could print our own check numbers instead of relying on preprinted stock. That gets rid of the headache of syncing numbers when line up pages are printed or printer jams occur.

    And, like Dave Barry likes to say, I am not making this up; it was called the Treasury Check Printing Improvement Project. Yup, "TCPIP".

  • faoileag (unregistered) in reply to Spanner number 3
    Spanner number 3:
    faoileag:
    This is somewhat similar to the reasoning: "Employees cost money. If I fire all employes, costs are greatly reduced. So profit must go up!"
    ...quite valid if profit is < 0 ...
    But only in a strictly mathematical sense! :-)
  • JavaScript vet (unregistered)

    Funny, removing whitespace works wonders for the speed of many Javascript projects/libraries. If that's all you knew, why not start with what you know works in your favorite language.

    I wish I was kidding.

  • Oslo (unregistered) in reply to JavaScript vet
    JavaScript vet:
    Funny, removing whitespace works wonders for the speed of many Javascript projects/libraries. If that's all you knew, why not start with what you know works in your favorite language.

    I wish I was kidding.

    I wonder if someone has made a minifier for compiled language sourcecode? That would be a real WTF.

  • (cs)

    It does improve the performance of people actually reading the thing, though: Less pointless scrolling, more useful text visible at a time...

  • faoileag (unregistered) in reply to Oslo
    Oslo:
    JavaScript vet:
    Funny, removing whitespace works wonders for the speed of many Javascript projects/libraries. If that's all you knew, why not start with what you know works in your favorite language.

    I wish I was kidding.

    I wonder if someone has made a minifier for compiled language sourcecode? That would be a real WTF.

    In the boundless realms of the internet, anything can be found. Even a C# code minifier: https://github.com/KvanTTT/CSharpMinifier

    No, Akismet, this is not spam. The link does not contain pork.

  • JAPH (unregistered) in reply to JavaScript vet
    JavaScript vet:
    Funny, removing whitespace works wonders for the speed of many Javascript projects/libraries. If that's all you knew, why not start with what you know works in your favorite language.

    I wish I was kidding.

    If you researched the problem, you would find that the JavaScript doesn't run faster just because it's been minimized; Minimized code takes up less bandwidth reducing slowdown for the client to receive it. Once the client has the code, both the minimized and normal code run the same.

  • (cs) in reply to JavaScript vet
    JavaScript vet:
    Funny, removing whitespace works wonders for the speed of many Javascript projects/libraries. If that's all you knew, why not start with what you know works in your favorite language.

    I wish I was kidding.

    I imagine that's because Javascript is interpreted. You could also speed up just about every program run through BASIC interpreters back in the day just by removing comments (REM). Commodore's BASIC also had tokenizing of commands. Besides the well-known "?" for PRINT, you could type the first letter of a command and press shift plus the second letter. Commodores displayed graphics characters when SHIFTed in uppercase mode, so you'd see something like a heart or line when you typed that second character. Besides saving a little RAM, it ran faster. Another trick was to use "." instead of "0". I never got around to benchmarking this to see if it worked.

    Addendum (2013-11-05 10:31):

    JavaScript vet:
    Funny, removing whitespace works wonders for the speed of many Javascript projects/libraries. If that's all you knew, why not start with what you know works in your favorite language.

    I wish I was kidding.

    I imagine that's because Javascript is interpreted. You could also speed up just about every program run through BASIC interpreters back in the day just by removing comments (REM). Commodore's BASIC also had tokenizing of commands. Besides the well-known "?" for PRINT, you could type the first letter of a command and press shift plus the second letter. Commodores displayed graphics characters when SHIFTed in uppercase mode, so you'd see something like a heart or line when you typed that second character. Besides saving a little RAM, it ran faster. Another trick was to use "." instead of "0". I never got around to benchmarking this to see if it worked.

    I forgot to mention that you didn't have to have spaces in your statements, and you could string multiple statements in one line separated by colons (this also saved RAM and CPU). It's no wonder my parents were befuddled when you saw things like this on the TV:

    10 FORI=1TO30:?SPC(I);">":NEXT

  • faoileag (unregistered) in reply to operagost
    operagost:
    You could also speed up just about every program run through BASIC interpreters back in the day just by removing comments (REM).
    And did we use the REMKILL command for that purpose? No, we used it because we ran out of memory (32K was all I had, those C64 kids were lucky!).
  • (cs) in reply to faoileag
    faoileag:
    operagost:
    You could also speed up just about every program run through BASIC interpreters back in the day just by removing comments (REM).
    And did we use the REMKILL command for that purpose? No, we used it because we ran out of memory (32K was all I had, those C64 kids were lucky!).
    Pfft, I had a VIC-20 with a 3K Color/Graphics expander for a whopping 6.5KB available. And I wrote a lot of stuff before I even had that! GOML
  • trololo (unregistered)

    They say that a developer's code mirrors perfectly the ideas inside his head....

  • trololo (unregistered)

    They say that a developer's code mirrors perfectly the ideas inside his head....

  • (cs) in reply to operagost
    operagost:
    Commodore's BASIC also had tokenizing of commands. Besides the well-known "?" for PRINT, you could type the first letter of a command and press shift plus the second letter. Commodores displayed graphics characters when SHIFTed in uppercase mode, so you'd see something like a heart or line when you typed that second character. Besides saving a little RAM, it ran faster.

    Actually BASIC keywords were stored as one or two bytes in memory no matter how you entered them. "?" and "PRINT" or "D(spade)" and "DATA" are the same thing. The trick was that every line in Commodore BASIC was limited to 80 characters (two lines on screen), so you could squeeze a few more on to each line by shortening the commands. Of course once you tried to LIST the code and edit it, every command was expanded again and it could wrap around to a third line causing all kinds of problems.

  • Mr. Information (unregistered)

    Sarcasm aside, I'd really like the OP to confirm: was the formatting the only change in the "optimized" version?

  • (cs) in reply to operagost
    operagost:
    Another trick was to use "." instead of "0". I never got around to benchmarking this to see if it worked.

    I remember reading about this, written by someone who claimed to have tested it, and apparently it was true.[citation needed][citation lost in the mists of Time]

    operagost:
    I forgot to mention that you didn't have to have spaces in your statements, and you could string multiple statements in one line separated by colons (this also saved RAM and CPU). It's no wonder my parents were befuddled when you saw things like this on the TV:

    10 FORI=1TO30:?SPC(I);">":NEXT

    The no-spaces thing wasn't universal across machines. IBM's PC BASIC (also Microsoft's GW-BASIC) had an assortment of reasons why you occasionally needed whitespace, such as this:

    10 FORI=XTOY:?I:NEXT
    The interpreter allowed (and would recognise as distinct) longer variable names than just two letters/one-letter-one-digit, and the tokeniser had to be smarter about chopping identifiers at the boundaries of tokens. So the line above would be tokenised as if it were:
    10 FOR I = XTOY : PRINT I : NEXT
    And it would fail at runtime with a syntax error.
    10 FORI=X TOY:?I:NEXT
    That, however, would work, because TOY *begins* with a token, so the token (TO) is correctly separated from the variable name (Y) that follows it.
  • (cs) in reply to DCRoss
    DCRoss:
    Actually BASIC keywords were stored as one or two bytes in memory no matter how you entered them. "?" and "PRINT" or "D(spade)" and "DATA" are the same thing. The trick was that every line in Commodore BASIC was limited to 80 characters (two lines on screen), so you could squeeze a few more on to each line by shortening the commands. Of course once you tried to LIST the code and edit it, every command was expanded again and it could wrap around to a third line causing all kinds of problems.
    Actually, the two-line limit was only on the C-64. On the VIC 20, the limit was four lines of 22 characters each, for a total of 88 characters. But the problem when editing a LISTed version of the command was the same.
  • lolatu (unregistered) in reply to Tim
    Tim:
    This is a bad poke fun at someone who was just doing their job. As a consultant I normally reformat code the first time I am through it just to make myself comfortable with the codebase before I go making large changes. This post seem immature and childish.

    Okay let me check the commit history to see where that bug Tim introduced is coming from... AHHHH! FUCK YOU TIM!

Leave a comment on “The New Line in Performance”

Log In or post as a guest

Replying to comment #:

« Return to Article