Re: Substring writes and buffered char streams
| From: | Wez Furlong | Date: | Sat, 07 Aug 2004 15:00:12 +0000 |
| Subject: | Re: Substring writes and buffered char streams | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-11992@lists.php.net to get a copy of this message | ||
> 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.
did you bother to benchmark php yet?
php != java (despite popular conspiracy theory).
> >$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?
yes and no ;)
the code is in PHP but not exposed to user-space. Turning it on is
trivial, but wont be available until 5.1, likewise with your proposed
modification for fwrite().