Skip to content

Commit c229d22

Browse files
committed
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.
1 parent 5620048 commit c229d22

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

app/models/api/translation_memory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
$source_strings_merged = array_merge($source_strings, $source_strings_merged);
4343
$target_strings_merged = array_merge($target_strings, $target_strings_merged);
44+
unset($source_strings, $target_strings);
4445
}
4546

4647
return $json = ShowResults::getTranslationMemoryResults(

0 commit comments

Comments
 (0)