Re: Efficiently parsing a File

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/18/2014 11:42 AM, Tiago Hori wrote:
> 
> Each File is about 1 MB. You are correct. Up to that point there is
> a bunch of useless info [...].
> 
  Then 5 minutes is a ridiculously long time for processing the file.

> SanitizeStrings just use htmlentities, striptags, stripslashes and 
> mysql_real_escape_string.
> 
  Is the data so suspect that it must be processed so thoroughly? I
expect it is in sanitizeStrings() where most of the time is spent.
Either sanitize the string in one pass, or only those parts that may
be an issue. Or not at all, having previously verified the integrity
of the data with another method (checksum, secure hash, secure data
connection, etc.).
  The other time-consuming part is insertion into the database. You
could accumulate the INSERT statements in memory or a file, then
submit it all at once.

- -- 
James Moe
moe dot james at sohnen-moe dot com
520.743.3936
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlMol/EACgkQzTcr8Prq0ZNwSwCfcuZebbh258Di7IbVq0Lp2X5V
dY4AninL2eVJsEMV5EuXBeJ8kvocPMn7
=/g5w
-----END PGP SIGNATURE-----

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux