Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11990 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36685 invoked by uid 1010); 7 Aug 2004 13:44:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36611 invoked from network); 7 Aug 2004 13:44:33 -0000 Received: from unknown (HELO admin01-nyc.clicvu.com) (209.10.150.70) by pb1.pair.com with SMTP; 7 Aug 2004 13:44:33 -0000 Received: from smtp.clicvu.com ([192.168.0.71]) by admin01-nyc.clicvu.com (Post.Office MTA v3.5.3 release 223 ID# 0-64039U1000L100S0V35) with ESMTP id com for ; Sat, 7 Aug 2004 09:42:18 -0400 Content-type: text/plain Date: Sat, 07 Aug 2004 09:42:04 -0400 To: internals@lists.php.net Subject: Re: [PHP-DEV] Substring writes and buffered char streams From: jtl_phpdotnet@spamex.com Message-ID: 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