Books for the NOC guys...
marty.anstey at sunwave.net
Tue Apr 6 13:05:27 CDT 2010
Max Gribov wrote:
> On 04/06/2010 01:17 PM, Marty Anstey wrote:
>> Nick Hilliard wrote:
>>> "PHP stinks on the command line and text processing"
>> This is a bit of a broad sweeping statement! Can you elaborate on what
>> your definition of how PHP "stinks" in this context?
> well, try to parse ~60mb csv file doing some simple tweaks to the
> input and then insert it into the database, and watch how much ram
> your script will use, as well as how long it will take vs perl..
> for me, it takes about 5 hours and eats up to 1gb of ram (configured
> memory limit for php for me)
While I appreciate where you're coming from, I've never had that issue.
It sounds like you're trying to load the entire script into RAM and then
parse it. Regardless of the language you are using, you'll still
essentially get the same result.
> that said, php is awesome otherwise, been using it for last 2 years
> strictly in 'enterprise' deployment..
> id just say perl is faster and more efficient for batch scripts.
I can't speak specifically to the performance differences for comparible
operations in PHP and PERL as I have never done a side-by-side
comparison myself. But FWIW, I have parsed multi-gigabyte files with PHP
on the command line and it's never been markedly "slow". Sure, it's not
pure C but it's never been so slow that i've thought - "heck, this would
be a lot faster with PERL"...
Just my $0.02...
More information about the NANOG