Please bottom post, and reply-all so that everyone can help and be helped.
Nope. That's a here are the tools that you should be able to determine on your own which is faster. ".... teach a man to fish ...."
http://danconia.org
Ken Gillett wrote:
That's a no then?
On 14 Feb 2005, at 15:00, Wiggins d'Anconia wrote:
Ken Gillett wrote:
I have a script that creates a hash, up to several thousand key=>value pairs. Each value is a string that is created by adding to it repeatedly, maybe hundreds of times, each addition probably about 10 bytes.
I can do this in (at least) 2 ways. One is to repeatedly concatenate ( .= ) the additional string onto a scalar variable and then, once it has been fully created, to add this variable to the hash with its appropriate key. The other is to directly add onto the hash value itself, no other variable involved.
My question is:-
Which is faster in operation?
I don't know enough about the internal workings of perl's memory structures (actually I know nothing about that:-) to be able to hazard a guess at this. Maybe it makes no measurable difference, but maybe one is definitely the better modus operandi.
Can anyone answer this?
perldoc Benchmark
Check the list archives for examples of usage on other problems.
Ken G i l l e t t
_/_/_/_/_/_/_/_/_/
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>