print “Array : “, procsize() - $base; First we create a large number of scalars, each holding a random 100-character string. Then we create a hash with three-character keys and the same number and lengths of values, and populate an array similarly. After each step, we measure how much our process size has grown by looking at what psprints in the SZ column. (It may be in a different column on your system; on non-Unix boxes you’ll need to use whatever support your OS gives for measuring process size.) The output we got was Scalars: 1749 Hash : 682 Array : 592 Packing multiple values in a scalar avoids the overhead of creating a new one. So instead of push @array, $value; #… foreach $element (@array) { … } you can do $scalar .= “$separator$value”; #… while (($element) = $scalar =~ s/(.*?)($separator|$)//o) { … } (Or, if speed is an issue, cook up something a little wordier using substrand index. If you were forming many small arrays, then you can just turn each one into a scalar that you spliton $separator one at a time.) This is a last-ditch optimization that costs dearly in readability; comment the heck out of it if you have to use it. Don’t form unnecessary lists. Some operations generate large lists when all you want to do is go through the elements one at a time. Structured data can usually be parsed a line at a time: while () { … } rather than reading the whole file: { local $/; $file = ; } Although in the case of data that’s not structured by lines, that may really be your best choice. The worst of both worlds would be to use the wrong loop statement:
Note: If you are looking for cheap and inexpensive provider to host and run your tomcat application check Actions tomcat hosting services