Re: What is the better method for using hash??
- From: xhoster@xxxxxxxxx
- Date: 02 Sep 2005 15:55:03 GMT
"sonet" <sonet.all@xxxxxxxxxxxxx> wrote:
> How to compare the memory usage??
I'd do it by measuring their memory usages (on a large enough sample), and
then comparing them. I find this to be convenient if not very portable:
print +(`ps -p $$ -o rss `)[1];
> What is the better??
>
> (A)
> hash1{TYPE1}{VALUE1}='A';
> hash1{TYPE1}{VALUE2}='B';
> hash1{TYPE1}{VALUE3}='C';
> hash1{TYPE2}{VALUE1}='1';
>
> or
> (B)
> TYPE1{VALUE1}='A';
> TYPE1{VALUE2}='B';
> TYPE1{VALUE2}='C';
> TYPE2{VALUE1}='1';
Neither is better. A is a syntax error, and B has nothing to do with
hashes (and is also a syntax error if you use strict).
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.
- References:
- What is the better method for using hash??
- From: sonet
- What is the better method for using hash??
- Prev by Date: Re: Adding values to anon hash of hash while looping...
- Next by Date: Re: Adding values to anon hash of hash while looping...
- Previous by thread: Re: What is the better method for using hash??
- Next by thread: Multiple substr() exchange
- Index(es):
Relevant Pages
|