Hello, On Sat, Aug 07, 2004 at 09:42:04AM -0400, [EMAIL PROTECTED] wrote: > Hi Wez. Here are some clarifications... > > On 8/7/2004 Wez. wrote: > >I suppose we could add that. Keep in mind that strings in PHP aren't > >hugely expensive unless you are doing something wrong (tm) like using > >10MB strings. > > Strings are cheap in Java too. The issue is object creation and cleanup. > When the strings are very large or very numerous, we could be talking > about thousands of substrings per page hit. This increases the strain > on both the clock speed and the memory of the host machine. Theory > aside, I can get as much as a tenfold improvement in throughput with such > techniques in Java.
Are you talking about PHP strings here are some self-cooked string class? If the former, you don't have to worry about object creation as strings are stored .val member of zval's and are not beafy PHP objects. If you your reading your data in a fixed-size chunk (e.g., <= 1024) performance won't be impacted that much my the mm, iirc, but the string functions (which are pretty fast :) > >$fp = fopen(...) ? > >$fp = tmpfile() ? > > Right, I should have mentioned this possibility. The main reason > for taking these precautions is throughput. I need in-memory > streams. Can I create a memory-only file? I dont think so (bar using one of the sysv shm interfaces). Best, Elfyn -- Elfyn McBratney beu/irc.freenode.net PGP Key ID: 0x456548B4 PGP Key Fingerprint: 29D5 91BB 8748 7CC9 650F 31FE 6888 0C2A 4565 48B4
pgpx6ZpARUZdz.pgp
Description: PGP signature