Subject: | massive speedup in folding code (redux) |
Hey, remember that 0.23 fix to make wrapping faster?
Turns out that it's -still- slow on very large (100k+) properties, which turn up sometimes. This patch (credit to ROBM, Rob Mueller) is speedup of around two orders of magnitude!
------
--- lib/Data/ICal/Property.pm 2020-01-03 09:12:08.000000000 -0500
+++ lib/Data/ICal/Property.pm.new 2020-04-15 08:32:01.210406228 -0400
@@ -332,9 +332,9 @@
my $out = substr($string, 0, 75, "") . $crlf;
- while (length $string) {
- my $substr = substr $string, 0, 74, "";
- $out .= " $substr$crlf";
+ if (length $string) {
+ $string =~ s/(.{1,74})/ $1$crlf/g;
+ $out .= $string;
}
return $out;
------
Took one export down from 23 minutes to 12 seconds. (!!!)
--
rjbs