> 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().

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to