On Sat, 2010-01-30 at 13:02 +1100, clanc...@cybec.com.au wrote:
> On Thu, 28 Jan 2010 10:02:56 -0500, rob...@interjinn.com (Robert Cummings)
> wrote:
>
>
> >I don't know what you guys are doing wrong but the following should be
> >the correct behaviour:
> >
> > >
> >function get_memory( $init=
On Thu, 28 Jan 2010 10:02:56 -0500, rob...@interjinn.com (Robert Cummings)
wrote:
>I don't know what you guys are doing wrong but the following should be
>the correct behaviour:
>
>
>function get_memory( $init=false )
>{
> static $base = null;
> if( $base === null || $init )
> {
>
Paul M Foster wrote:
On Thu, Jan 28, 2010 at 11:41:43AM -, Ford, Mike wrote:
-Original Message-
From: Rene Veerman [mailto:rene7...@gmail.com]
Sent: 27 January 2010 22:46
And if your script needs to pass large (> 5Mb) arrays around to
functions, be sure to use passing-by-reference;
On Thu, Jan 28, 2010 at 11:41:43AM -, Ford, Mike wrote:
> > -Original Message-
> > From: Rene Veerman [mailto:rene7...@gmail.com]
> > Sent: 27 January 2010 22:46
> >
> > And if your script needs to pass large (> 5Mb) arrays around to
> > functions, be sure to use passing-by-reference;
Nathan Rixham wrote:
Ford, Mike wrote:
-Original Message-
From: Rene Veerman [mailto:rene7...@gmail.com]
Sent: 27 January 2010 22:46
And if your script needs to pass large (> 5Mb) arrays around to
functions, be sure to use passing-by-reference; failing to do so can
double your memory re
> -Original Message-
> From: Nathan Rixham [mailto:nrix...@gmail.com]
> Sent: 28 January 2010 13:43
>
> Ford, Mike wrote:
> >> -Original Message-
> >> From: Rene Veerman [mailto:rene7...@gmail.com]
> >> Sent: 27 January 2010 22:46
> >>
> >> And if your script needs to pass large (>
Ford, Mike wrote:
>> -Original Message-
>> From: Rene Veerman [mailto:rene7...@gmail.com]
>> Sent: 27 January 2010 22:46
>>
>> And if your script needs to pass large (> 5Mb) arrays around to
>> functions, be sure to use passing-by-reference; failing to do so can
>> double your memory requir
Thanks for your research Mike, i'm a bit puzzled.
I have a custom random-array generator that i use to fill the
available memory to it's max, about 1.5G on a 2G system, then passing
it to a recursive json string generator.
Not passing by reference did double my memory requirements, but i've
change
> -Original Message-
> From: Rene Veerman [mailto:rene7...@gmail.com]
> Sent: 27 January 2010 22:46
>
> And if your script needs to pass large (> 5Mb) arrays around to
> functions, be sure to use passing-by-reference; failing to do so can
> double your memory requirements,
> possibly hitti
Nathan Rixham wrote:
> Daniel Egeberg wrote:
>> On Wed, Jan 27, 2010 at 18:13, Daniel Brown wrote:
>>> On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote:
There is virtually no difference nowadays. It's a long time since
anything like that has mattered.
>>>Actually, that's not true
Richard Quadling wrote:
> 2010/1/27 Richard Quadling :
>> 2010/1/27 Michael A. Peters :
>>> Paul M Foster wrote:
"... should be obvious - but are often overlooked - points within coding
practice that can cause the programmer to develop bad habits and bad
code." - Dan Brown
Daniel Egeberg wrote:
> On Wed, Jan 27, 2010 at 18:13, Daniel Brown wrote:
>> On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote:
>>> There is virtually no difference nowadays. It's a long time since
>>> anything like that has mattered.
>>Actually, that's not true enough to be dismissive. I
I'd like to add that when dealing with large memory structures,
usually arrays, combining them is fastest when done like this:
$array1 += $array2;
This will not always produce correct results when dealing with arrays
that contain identical keys, but for non-overlapping arrays it is far
faster tha
Daniel Brown wrote:
On Wed, Jan 27, 2010 at 12:27, Ashley Sheridan
wrote:
Depends I guess on how far you need to optimise the code. I'd imagine that to
something like Facebook, every split-second of optimisation is worth it, as
even a 100th of a second becomes minutes of wasted time over t
On Wed, Jan 27, 2010 at 12:27, Ashley Sheridan
wrote:
>
> Depends I guess on how far you need to optimise the code. I'd imagine that to
> something like Facebook, every split-second of optimisation is worth it, as
> even a 100th of a second becomes minutes of wasted time over the course of a
>
Ashley Sheridan wrote:
On Wed, 2010-01-27 at 18:26 +0100, Daniel Egeberg wrote:
On Wed, Jan 27, 2010 at 18:13, Daniel Brown wrote:
On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote:
There is virtually no difference nowadays. It's a long time since
anything like that has mattered.
Actu
On Wed, Jan 27, 2010 at 12:26, Daniel Egeberg wrote:
>
> Well, I would still say it's far too insignificant to bother with.
And for the most part, you'd be right but it still isn't good
practice to *not* teach something strictly because it's not entirely
significant.
For example, pol
On Wed, 2010-01-27 at 18:26 +0100, Daniel Egeberg wrote:
> On Wed, Jan 27, 2010 at 18:13, Daniel Brown wrote:
> > On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote:
> >>
> >> There is virtually no difference nowadays. It's a long time since
> >> anything like that has mattered.
> >
> >Actu
On Wed, Jan 27, 2010 at 18:13, Daniel Brown wrote:
> On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote:
>>
>> There is virtually no difference nowadays. It's a long time since
>> anything like that has mattered.
>
> Actually, that's not true enough to be dismissive. It depends on
> several
On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote:
>
> There is virtually no difference nowadays. It's a long time since
> anything like that has mattered.
Actually, that's not true enough to be dismissive. It depends on
several factors.
--
daniel.br...@parasane.net || danbr...@php.net
On Wed, Jan 27, 2010 at 16:44, Ashley Sheridan
wrote:
> What about using the right type of quotation marks for output:
>
> I use double quotes(") if I expect to output variables within the
> string, and single quotes when it's just a simple string.
>
> It's only a general rule of thumb and should
2010/1/27 Richard Quadling :
> 2010/1/27 Michael A. Peters :
>> Paul M Foster wrote:
>>>
>>> "... should be obvious - but are often overlooked - points within coding
>>> practice that can cause the programmer to develop bad habits and bad
>>> code." - Dan Brown
>>>
>>> Tip #1:
>>>
>>> Don't use cou
Richard Quadling wrote:
for ($i = 0, $j = count($a) ; $i < $j ; ++$i) {
}
is a very common way to handle that.
Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
2010/1/27 Michael A. Peters :
> Paul M Foster wrote:
>>
>> "... should be obvious - but are often overlooked - points within coding
>> practice that can cause the programmer to develop bad habits and bad
>> code." - Dan Brown
>>
>> Tip #1:
>>
>> Don't use count() in loops unless there are very few
On Thu, 2010-01-28 at 00:08 +0800, Eric Lee wrote:
> On Wed, Jan 27, 2010 at 11:44 PM, Ashley Sheridan
> wrote:
>
> > On Wed, 2010-01-27 at 10:42 -0500, Paul M Foster wrote:
> >
> > > "... should be obvious - but are often overlooked - points within coding
> > > practice that can cause the progra
On Wed, Jan 27, 2010 at 11:44 PM, Ashley Sheridan
wrote:
> On Wed, 2010-01-27 at 10:42 -0500, Paul M Foster wrote:
>
> > "... should be obvious - but are often overlooked - points within coding
> > practice that can cause the programmer to develop bad habits and bad
> > code." - Dan Brown
> >
> >
On Wed, 2010-01-27 at 08:01 -0800, Michael A. Peters wrote:
> Paul M Foster wrote:
> > "... should be obvious - but are often overlooked - points within coding
> > practice that can cause the programmer to develop bad habits and bad
> > code." - Dan Brown
> >
> > Tip #1:
> >
> > Don't use count(
Paul M Foster wrote:
"... should be obvious - but are often overlooked - points within coding
practice that can cause the programmer to develop bad habits and bad
code." - Dan Brown
Tip #1:
Don't use count() in loops unless there are very few items to count and
performance doesn't matter, or th
On Wed, 2010-01-27 at 10:42 -0500, Paul M Foster wrote:
> "... should be obvious - but are often overlooked - points within coding
> practice that can cause the programmer to develop bad habits and bad
> code." - Dan Brown
>
> Tip #1:
>
> Don't use count() in loops unless there are very few item
29 matches
Mail list logo