Re: Substring writes and buffered char streams
| From: | jtl_phpdotnet at spamex dot com | Date: | Sat, 07 Aug 2004 13:42:04 +0000 |
| Subject: | Re: Substring writes and buffered char streams | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-11990@lists.php.net to get a copy of this message | ||
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.
>$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?
Thanks for your help!
~joe