Just for confirmation:
Linux Mandrake 8.1, PHP 4.0.6, PIII 600MHz, using Jason's code:
- Original code via HTTP:
1st attempt
3.4497429132462
3.1789749860764
[7.85% faster with bit op's]
2nd attempt (reload)
3.3336659669876
3.1573359966278
[5.29% faster with bit op's]
- Original code from the c
On Monday 20 May 2002 12:03, Martin Towell wrote:
> I was doing some timing of a function on the weekend and in one of the
> loops, I had to multiply a variable by 2 - easy enough - $i*2
>
> but then I remembered that in C, it's quicker to do a left shift - so $i<<1
>
> but this actually took long
I was doing some timing of a function on the weekend and in one of the
loops, I had to multiply a variable by 2 - easy enough - $i*2
but then I remembered that in C, it's quicker to do a left shift - so $i<<1
but this actually took longer to execute in php than the $i*2 - can anyone
confirm my t
3 matches
Mail list logo