Path: utzoo!attcan!uunet!bfmny0!tneff From: tneff@bfmny0.BFM.COM (Tom Neff) Newsgroups: comp.lang.perl Subject: Optimizing Perl malloc's Message-ID: <15705@bfmny0.BFM.COM> Date: 27 Jul 90 06:37:40 GMT Reply-To: tneff@bfmny0.BFM.COM (Tom Neff) Lines: 22 I have a script that repeatedly appends words onto a string, then prints and clears the string. while (...) { $coll = ''; while (...) { $coll .= &getaword; ... } &mess_with($coll); print RESULT $coll; } It doesn't run as fast as I'd like, and I'm looking for things to tweak. Question -- am I doing one or more malloc's every time I append a word? Am I wasting a lot of system overhead this way? If so, is there a reasonable way to "pre-allocate" or somehow avoid the problem? -- Stalinism begins at home. }{ Tom Neff }{ tneff@bfmny0.BFM.COM