From 6d3fa5c8718b01babd26d63b53da984c6641c22c Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 2 Apr 2015 17:34:47 +0200 Subject: Pygments::get_pygments_info: cache in memory It's used multiple times if we are rendering a multipaste so it makes sense not to run to the backend cache each time (if there even is one). This reduced the render time for a multipaste with 180 items from >500ms to ~225ms when using the file cache backend. Signed-off-by: Florian Pritz --- application/libraries/Pygments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/Pygments.php b/application/libraries/Pygments.php index 24975d6a1..12f6d7037 100644 --- a/application/libraries/Pygments.php +++ b/application/libraries/Pygments.php @@ -21,7 +21,7 @@ class Pygments { } private static function get_pygments_info() { - return cache_function('pygments_info', 1800, function() { + return cache_function_full('pygments_info', 1800, function() { ob_start(); passthru("python ".escapeshellarg(FCPATH."scripts/get_lexer_list.py")); $output = ob_get_clean(); -- cgit v1.2.3-24-g4f1b