Re: Server->HTMLEncode speed

2001-09-21 Thread Philip Mak
On Fri, 21 Sep 2001, Quentin Smith wrote: > Why not use the fastest code of all? > print ""; > open(FANFIC, "$file") or print "File not found:$!\n"; > print $_ while (); > close(FANFIC); is an obsolete tag---it's actually illegal in HTML 4.0. Some web browsers (including Opera 5.12, which I use

Re: Server->HTMLEncode speed

2001-09-21 Thread Quentin Smith
On Thu, 20 Sep 2001, Philip Mak wrote: > I have a page on my website that prints a plain text file in HTML. So, it > does something like this: > > print ""; > open(FANFIC, "$file") or print "File not found: $!\n"; > print Apache::Util::escape_html($_) while (); > close(FANFIC); > print

Re: Server->HTMLEncode speed

2001-09-20 Thread Philip Mak
On Thu, 20 Sep 2001, Joshua Chamas wrote: > If you would humor me, I wonder what the speed would be if > you used $Server->HTMLEncode() with that optimization? > I would be really surprised if it was < 40 req/sec. Well, this is interesting. I just benchmarked it, and $Server->HTMLEncode() is 44

Re: Server->HTMLEncode speed

2001-09-20 Thread Joshua Chamas
Philip Mak wrote: > > Thanks for the tip about escaping it all at once, instead of line by line. > I ended up doing this on my website, since it'll always be hosted on > Apache/Linux (I think): > > local $/ = undef; > print escape_html(); # from Apache::Util > > That script is now up to 45 requ

Re: Server->HTMLEncode speed

2001-09-20 Thread Philip Mak
Thanks for the tip about escaping it all at once, instead of line by line. I ended up doing this on my website, since it'll always be hosted on Apache/Linux (I think): local $/ = undef; print escape_html(); # from Apache::Util That script is now up to 45 requests per second (it was originally 30

Re: Server->HTMLEncode speed

2001-09-20 Thread Joshua Chamas
Philip Mak wrote: > > I have a page on my website that prints a plain text file in HTML. So, it > does something like this: > > print ""; > open(FANFIC, "$file") or print "File not found: $!\n"; > print Apache::Util::escape_html($_) while (); > close(FANFIC); > print "\n"; > > I used

Server->HTMLEncode speed

2001-09-20 Thread Philip Mak
I have a page on my website that prints a plain text file in HTML. So, it does something like this: print ""; open(FANFIC, "$file") or print "File not found: $!\n"; print Apache::Util::escape_html($_) while (); close(FANFIC); print "\n"; I used to use $Server->HTMLEncode() instead of A