[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
newlispfanclub.alh.net • View topic - read-line optimisation

read-line optimisation

Q&A's, tips, howto's

read-line optimisation

Postby Astrobe » Tue Mar 04, 2014 8:42 am

Astrobe
 
Posts: 39
Joined: Mon Jan 11, 2010 9:41 pm

Re: read-line optimisation

Postby Lutz » Tue Mar 04, 2014 6:49 pm

Thanks Astrobe. At the moment I don't recall why read-line was coded using fgetc() and not fgets(), but in the past a lot of problems occurred with read-line, using it on different OSs and for CGI in conjunction with different client web browsers on the web and using sockets on Unix as file handles and also when using pipes. So this change will need a lot of testing, but the speed improvement is certainly worth it.
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: read-line optimisation

Postby Lutz » Tue Mar 04, 2014 8:24 pm

I just realize that your version limits the line length to MAX_STRING, readStreamLine() should be able too read any line length.
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: read-line optimisation

Postby Lutz » Wed Mar 05, 2014 3:52 am

Seems to pass all tests:

http://www.newlisp.org/downloads/develo ... nprogress/

Linux, Windows, OSX and FreeBSD seem to be fine. Gains are biggest on Linux and on longer lines than usually found in text files. For TRU64 the old method has been left, as I cannot test it.
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest

cron