Skip to content

[PATCH] sequential mode #393

Description

@axet

HDD significantly reduce performance if booth scanning and csum calculating done at the same time. Reducing IO/hash treahds to 1 does not help, since scanning done in main thread. Following patch will let use duperemove on HDD

diff --git a/file_scan.c b/file_scan.c
index 0760b9c..d0859db 100644
--- a/file_scan.c
+++ b/file_scan.c
@@ -1239,12 +1239,18 @@ int add_exclude_pattern(const char *pattern)
 void filescan_init(void)
 {
 	abort_on(scan_pool.pool);
-	setup_pool(&scan_pool, csum_whole_file, NULL, options.io_threads);
+	setup_pool(&scan_pool, csum_whole_file, NULL, 0);
 	abort_on(!scan_pool.pool);
 }
 
 void filescan_free(void)
 {
+	GError *err = NULL;
+	if (!g_thread_pool_set_max_threads(scan_pool.pool, options.io_threads, &err )) {
+		eprintf("g_thread_pool_set_max_threads: %s\n", err->message);
+		g_error_free(err);
+		err = NULL;
+	}
 	free_pool(&scan_pool);
 }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions