nanog mailing list archives

Re: Books for the NOC guys...


From: "Robert E. Seastrom" <rs () seastrom com>
Date: Tue, 06 Apr 2010 16:14:37 -0400


Marty Anstey <marty.anstey () sunwave net> writes:

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.

As it happens, the loadup script I wrote that parses ARIN bulk whois
dump data and loads it into an SQL database is both written in PHP and
about an order of magnitude faster than its predecessor which was
written by someone else in perl.

Helps that I knew enough to LOCK TABLES...  :-)

-r




Current thread: