Don't attempt to syntax highlight anything big.
Dan Brook [Sun, 5 Jun 2011 21:20:06 +0000 (23:20 +0200)]
Basically Syntax::Highlight::Kate is slow and trying to prettify
anything relative big s really slow. So just don't even try. Sad face.

lib/Gitalist/View/SyntaxHighlight.pm

index 9c28341..4f675ab 100644 (file)
@@ -17,6 +17,9 @@ sub process {
 
 sub render {
     my ($self, $c, $blob, $args) = @_;
+
+    # Don't bother with anything over 64kb, it'll be tragically slow.
+    return encode_entities $blob if length $blob > 8192;
     
     my $lang = $args->{language};