# HG changeset patch # User Matti Hamalainen # Date 1560765273 -10800 # Node ID a4c1fafd442a577430c844593a320eb4a9e3e86b # Parent 6878aad714ce9e0d014ede834bdb8f58b4730851 Add a progress indicator when "slow" matching is expected. diff -r 6878aad714ce -r a4c1fafd442a tools/fanalyze.c --- a/tools/fanalyze.c Mon Jun 17 11:50:33 2019 +0300 +++ b/tools/fanalyze.c Mon Jun 17 12:54:33 2019 +0300 @@ -928,7 +928,9 @@ // // Attempt to find matching sequences of N+ // - dmPrint(0, "Attempting to find matching sequences of %" DM_PRIu_SIZE_T" bytes or more\n", + BOOL slow = FALSE; + int ss = 0; + dmPrint(0, "Attempting to find matching sequences of %" DM_PRIu_SIZE_T" bytes or more.\n", optMinMatchLen); if (totalSize > 32*1024) @@ -936,6 +938,7 @@ dmPrint(0, "WARNING! Total data size is large, and the matching \"algorithm\"\n" "used is horribly inefficient. This will be quite slow ...\n"); + slow = TRUE; } for (int nfile1 = 0; nfile1 < nsrcFiles; nfile1++) @@ -947,6 +950,13 @@ { DMSourceFile *file2 = &srcFiles[nfile2]; + if (slow) + { + dmPrint(0, + "Processing .. %1.1f%%\r", + (float) ss * 100.0f / (float) (nsrcFiles * (nsrcFiles - 1))); + ss++; + } // Find longest possible matching sequence in file2, if any for (size_t moffs1 = 0; moffs1 + optMinMatchLen < file1->size;) { @@ -980,6 +990,9 @@ done: + if (slow) + dmPrint(0, "\n\n"); + for (int nmatch = 0; nmatch < ndmSequences; nmatch++) { DMMatchSeq *seq = &dmSequences[nmatch];