From 783ed0f881f731c3b63a0f259815a5ce79c223d4 Mon Sep 17 00:00:00 2001 From: erius Date: Mon, 28 Oct 2024 18:35:43 +0300 Subject: [PATCH] Added notes to the ftsort.cpp file about optimal memory-limit value --- bin/ftsort/ftsort.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/ftsort/ftsort.cpp b/bin/ftsort/ftsort.cpp index 2f473a1..2b87f55 100644 --- a/bin/ftsort/ftsort.cpp +++ b/bin/ftsort/ftsort.cpp @@ -30,6 +30,10 @@ size_t get_mem_peak() { return mem; } +// if we assume N as INPUT tape size, we can calucalte the optimal memory-limit +// by using this formula: +// X = sqrt(8000*N) +// where X is the optimal memory-limit value int main(int argc, char *argv[]) { AppSettings settings = parse_command_line(argc, argv); if (settings.version) {