Just did some unscientific but interesting tests between php's concat and php's double quotes. I heard once that doing single quote concat like:
' My ' . $name . ' is '
Is faster than doing the double quote in-line like:
"My $name is"
So i decided to put this into a mini test. I created some strings and put them into variable. Then in a while loop I used "" in one test, and ' ' . '' in another. Argue with my test if you will but both scripts result in the same action, only ONE is faster.
I ran the test script 40 times, why 40? cause it took about 80 minutes to complete the whole thing. Want more? do it yourself :)
String concat 6 times in one string for 100,000,000 runs
Using the php . method: averaged 87.36 seconds
Using the php " $var " method: averaged 78.83 seconds
Whats this mean? It could mean that using " $var " is 9.76% faster than using the . method.
What does this actually mean?
While could potentially benefit from choosing "$var" over the . method, the likely hood is you won't unless you are doing this * a lot *. If your script only takes 1 second to execute then you are only going to gain about 9% speed on that single instruction with "$var" over the ' ' . ' ' method. You will not gain 9% speed on the entire script run unless the only thing your script does is Concat strings. So does it matter? It could I guess if you are going to run the script a few million times. Just food for thought.
Scripts Used:
php . method script
php "$var" method script
Thursday, May 27, 2010
Monday, March 9, 2009
Coraline (2009)
Henry Selick, out on his own taking a step away from Tim Burton, maybe? No, not really. Tim Burton movies were fantastic, creative, and unique. Formed by dark artwork and worlds where art interacts with the characters. This makes the Tim Burton universe seem alive with emotional plants, rocks, bone dogs, in a way that everything shows it can feel the sorrow of the world. However, the key words are "were fantastic, creative, and unique". Due to releasing more movies and stories the Tim Burton universe has become common, stagnant, and desperately grasping for stories that don't make us sit in our chairs for more than an hour taking 4 bathroom breaks just to stay awake.
So you would like to point out this wasn't a Tim Burton movie, or a Tim Burton universe, or a Tim Burton story? Go ahead point it out all you want. This was definitely a Tim Burton film. What you should be asking is, maybe all Tim Burton films are actually Henry Selick. Nobody can tell the difference.
So you would like to point out this wasn't a Tim Burton movie, or a Tim Burton universe, or a Tim Burton story? Go ahead point it out all you want. This was definitely a Tim Burton film. What you should be asking is, maybe all Tim Burton films are actually Henry Selick. Nobody can tell the difference.
Saturday, February 7, 2009
The Mummy: Tomb of the Dragon Emperor (DVD)
What a drag... Slow in the beginning. Practically Zero action. Half the original cast is missing, and the replacements suck. Slow in the middle. Instant falling in love between 2 people trying to kill eachother. Sad writing, a 2000 year old Emperor that just wakes up knows more about dynamite, cars, trucks, boxed fireworks, travel, and eternal life than the average human. Dialog flows about as well as this post. Responses to dialogs are... unrealistic... Humor non-existance except for 2-3 laughs that I could have gotten watching a cat play with a shoe string.
What did I do this weekend? Purchased this amazing DVD for $20 at target... Do they allow returns?
What did I do this weekend? Purchased this amazing DVD for $20 at target... Do they allow returns?
Monday, January 26, 2009
Underworld: Rise of the Lycans
I was a huge fan of the first 2 movies Undeworld and Underworld: Evolution. I find Rise of the Lycans completely worthless. While watching it I was pressed with the feeling that I had pretty much seen all this before somewhere.. WAIT, I had, in all the flashbacks of the previous and Rise of the Lycans simply retells the same story and scenes in minor depth. Directors, DON'T prequel things that were already extensively covered in other movies! The CGI was horrid and blurry with grotesquely obvious places where entire faces and bodies were fake. (guy getting hit in the face with large spear). Don't get me started on the wolf costumes.. To sum up, this movie had mid 1990's CGI work, a plot completely covered by other movies in the series, and the DUMBEST sex seen I believe I have ever seen on film... Hanging off the edge of a cliff.. are you serious.
Thursday, January 17, 2008
Troubles with the Qt4 Documentation
Over the years since Qt4 has been released I've been a strong dedicated follower of the direction Trolltech has chosen to develop Qt. When using just regular Qt4 the toolkit shines with pride in the fact that it has the most complete and easy access documentation system to ever be seen. The fact that Qt is both commercial and open source has fathered the way for some of the best documentation ever created for an open source project.
My outlook on Trolltech's documentation was hindered greatly over the last week as I work with Qtopia-core and Qtopia. Being dependent on Assistant to help me along the way with the vast world of Qt classes I stumbled upon an area I did not expect to find. The QWS class functions are documented publicly in Assistant and on the Web but the usefulness of these classes has been cut down to useless by the public documentation. So much that one has to wonder why these classes even exists since they can't do anything useful for window management.
I was surprised to find I had to dig deeper into the Qtopia-core header files to find the details of what QWS classes are actually used for. In the header files I found a great many public functions that Trolltech has simply opted to leave completely out of documentation. The same exact functions that make Window management possible with the QWSServer.
I'm not really mad or upset about these items not being documented. However, it just would have been nice to know that while Trolltech's documentation is great they still feel the need to leave out basic and required documentation in favor of letting us all sit around and scratch our heads trying to figure out "how do i do this relatively simple task that any window manager should beable to do!". Guess from now on, we'll just go to the headers.
My outlook on Trolltech's documentation was hindered greatly over the last week as I work with Qtopia-core and Qtopia. Being dependent on Assistant to help me along the way with the vast world of Qt classes I stumbled upon an area I did not expect to find. The QWS class functions are documented publicly in Assistant and on the Web but the usefulness of these classes has been cut down to useless by the public documentation. So much that one has to wonder why these classes even exists since they can't do anything useful for window management.
I was surprised to find I had to dig deeper into the Qtopia-core header files to find the details of what QWS classes are actually used for. In the header files I found a great many public functions that Trolltech has simply opted to leave completely out of documentation. The same exact functions that make Window management possible with the QWSServer.
I'm not really mad or upset about these items not being documented. However, it just would have been nice to know that while Trolltech's documentation is great they still feel the need to leave out basic and required documentation in favor of letting us all sit around and scratch our heads trying to figure out "how do i do this relatively simple task that any window manager should beable to do!". Guess from now on, we'll just go to the headers.
Subscribe to:
Posts (Atom)