PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > Speeding question, " vs '
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Speeding question, " vs '

Réponse
 
LinkBack Outils de la discussion
Vieux 30/04/2008, 13h08   #1
jodleren
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Speeding question, " vs '

Hi!

It just crossed my mind, that I usually do it like this:

$whatver=$_POST["returned_value"];

instead of

$whatver=$_POST['returned_value'];

The latter should be faster, as within ' nothing is replaced as in ".
I now wornder, what difference this makes in speed?
It should make some, but not really.... then again, with 10000000
users, it might.

What do you do?

WBR
Sonnich
  Réponse avec citation
Vieux 30/04/2008, 13h11   #2
C. (http://symcbean.blogspot.com/)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Speeding question, " vs '

On 30 Apr, 13:08, jodleren <sonn...@hot.ee> wrote:
> Hi!
>
> It just crossed my mind, that I usually do it like this:
>
> $whatver=$_POST["returned_value"];
>
> instead of
>
> $whatver=$_POST['returned_value'];
>
> The latter should be faster, as within ' nothing is replaced as in ".
> I now wornder, what difference this makes in speed?
> It should make some, but not really.... then again, with 10000000
> users, it might.
>
> What do you do?



If it it was that important to me I'd:
1) research the issue - which is well documented
2) test it for myself

and perhaps even share my findings.

C.
  Réponse avec citation
Vieux 30/04/2008, 13h45   #3
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Speeding question, " vs '

jodleren wrote:
> Hi!
>
> It just crossed my mind, that I usually do it like this:
>
> $whatver=$_POST["returned_value"];
>
> instead of
>
> $whatver=$_POST['returned_value'];
>
> The latter should be faster, as within ' nothing is replaced as in ".
> I now wornder, what difference this makes in speed?
> It should make some, but not really.... then again, with 10000000
> users, it might.
>
> What do you do?
>
> WBR
> Sonnich
>


I generally use single quotes, mostly out of habit. But the difference
is going to be negligible. And if you have so many users that it's
overloading your system, chances are other things will contribute more
to enhancing your performance.

Don't try to prematurely optimize. All it will do is delay your project
and give you ulcers.

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

  Réponse avec citation
Vieux 30/04/2008, 13h46   #4
Joe Scylla
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Speeding question, " vs '

jodleren wrote:
> Hi!
>
> It just crossed my mind, that I usually do it like this:
>
> $whatver=$_POST["returned_value"];
>
> instead of
>
> $whatver=$_POST['returned_value'];
>
> The latter should be faster, as within ' nothing is replaced as in ".
> I now wornder, what difference this makes in speed?
> It should make some, but not really.... then again, with 10000000
> users, it might.
>
> What do you do?


The difference is too small to care about - even with 10M Users.

I can't say whats faster because the difference is so small that if i
iterate both methods 10M times the result get corrupted by external
factors like if there are other tasks that "steal" cpu time.

From the logical point of view single quotes should be faster because
single quotes don't support varibale substitution.

Personally i use double quotes all the time.

Joe
  Réponse avec citation
Vieux 30/04/2008, 14h45   #5
Guillaume
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Speeding question, " vs '

jodleren a écrit :
> What do you do?


I almost always use single quotes, because of those variables not
treated, if I want to include one I explicitely do it.

Almost, cause I use double quotes in SQL queries, where I use single
quote for value statements (and always use curly brackets for variables,
which makes it clearer imo to delimitate the variable names)

"INSERT INTO dummy (name) VALUES ('{$name}')"

Regards,
--
Guillaume
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h55.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09690 seconds with 13 queries