Skip to content
Browse files

Save memory on Global search API

By unsetting the $target_strings and $source_strings, we save 9MB per request, which is probably a good thing for performances of the API (for Pontoon).

That's an easy win on existing code.
  • Loading branch information
pascalchevrel committed Jan 11, 2016
1 parent 5620048 commit c229d22da6c23484c084e4f2febad2f1cb30e42b
Showing with 1 addition and 0 deletions.
  1. +1 −0 app/models/api/translation_memory.php
@@ -41,6 +41,7 @@

$source_strings_merged = array_merge($source_strings, $source_strings_merged);
$target_strings_merged = array_merge($target_strings, $target_strings_merged);
unset($source_strings, $target_strings);

return $json = ShowResults::getTranslationMemoryResults(

0 comments on commit c229d22

Please sign in to comment.
You can’t perform that action at this time.