This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Perl inefficiency...



$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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]