X-Spam-Check-By: sourceware.org
Message-ID: <45B7CADC.4050502@tlinx.org>
Date: Wed, 24 Jan 2007 13:08:44 -0800
From: Linda Walsh <cygwin@tlinx.org>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Perl inefficiency...
References: <20070122181727.GC27843@calimero.vinschen.de> <1552.67.40.28.188.1169493973.squirrel@67.40.28.188> <20070122202137.GC20665@calimero.vinschen.de> <3593.67.40.28.188.1169584799.squirrel@67.40.28.188> <20070124100540.GP27843@calimero.vinschen.de>
In-Reply-To: <20070124100540.GP27843@calimero.vinschen.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com


$a="a";          (uses 2 Bytes)
$a="a" * 100Meg; (uses 200MB)
$b="b" * 100Meg;
...

I may be reading this incorrectly, but I don't think the question
is why storage for the separate strings "$a", "$b" isn't freed, but
why would perl use 2 bytes/character?  I thought perl used UTF-8
internally(?).  Shouldn't it be using closer to 100MB to store
100-Million chars?

Of course if perl had a "use-less-memory" pragma, I might even
"hope" that it would store the above string as a repeat-count
followed by the string...but that would be expecting a bit...

I understand perl may not be as efficient in data storage as
C, but seems like expanding a 100MB string to take 200MB is
wasting 100MB. 

Is this what you were referring to, Corinna?

Linda




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

