From 38d83324671b4110614dbef30acef4a1543ee065 Mon Sep 17 00:00:00 2001 From: Paul Emmerich Date: Sat, 27 Apr 2024 14:51:12 +0200 Subject: Add multi-process support to --check. Set the parameter --num_threads to the desired number of worker tasks to potentially speed up --check. This works by spawning multiple sub-proccesses that each run the desired diagnostics on a subset of the workspace. Each process will still load and compile the entire workspace, so there are diminishing returns and memory usage increases linearly with the number of threads. Overall this can reduce the runtime by about ~50% for my projects, example results: Workspace 1, dominated by a few large/complex files 1 thread: 49.7 seconds 2 threads: 31.8 seconds 4 threads: 23.6 seconds 8 threads: 24.4 seconds Workspace 2, large number of small-ish files 1 thread: 96.0 seconds 2 threads: 76.5 seconds 4 threads: 49.5 seconds 8 threads: 38.1 seconds --- locale/en-us/script.lua | 2 ++ locale/pt-br/script.lua | 2 ++ locale/zh-cn/script.lua | 2 ++ locale/zh-tw/script.lua | 2 ++ 4 files changed, 8 insertions(+) (limited to 'locale') diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua index 49751d52..6fc488d8 100644 --- a/locale/en-us/script.lua +++ b/locale/en-us/script.lua @@ -650,6 +650,8 @@ CLI_CHECK_PROGRESS = 'Found {} problems in {} files' CLI_CHECK_RESULTS = 'Diagnosis complete, {} problems found, see {}' +CLI_CHECK_MULTIPLE_WORKERS = +'Starting {} worker tasks, progress output will be disabled. This may take a few minutes.' CLI_DOC_INITING = 'Loading documents ...' CLI_DOC_DONE = diff --git a/locale/pt-br/script.lua b/locale/pt-br/script.lua index 7a114fef..468812cc 100644 --- a/locale/pt-br/script.lua +++ b/locale/pt-br/script.lua @@ -650,6 +650,8 @@ CLI_CHECK_PROGRESS = -- TODO: need translate! 'Found {} problems in {} files' CLI_CHECK_RESULTS = 'Diagnóstico completo, {} problemas encontrados, veja {}' +CLI_CHECK_MULTIPLE_WORKERS = -- TODO: need translate! +'Starting {} worker tasks, progress output will be disabled. This may take a few minutes.' CLI_DOC_INITING = -- TODO: need translate! 'Loading documents ...' CLI_DOC_DONE = -- TODO: need translate! diff --git a/locale/zh-cn/script.lua b/locale/zh-cn/script.lua index c16a764f..a4d20628 100644 --- a/locale/zh-cn/script.lua +++ b/locale/zh-cn/script.lua @@ -650,6 +650,8 @@ CLI_CHECK_PROGRESS = -- TODO: need translate! 'Found {} problems in {} files' CLI_CHECK_RESULTS = '诊断完成,共有 {} 个问题,请查看 {}' +CLI_CHECK_MULTIPLE_WORKERS = -- TODO: need translate! +'Starting {} worker tasks, progress output will be disabled. This may take a few minutes.' CLI_DOC_INITING = '加载文档 ...' CLI_DOC_DONE = diff --git a/locale/zh-tw/script.lua b/locale/zh-tw/script.lua index 1deb9877..c17c41fb 100644 --- a/locale/zh-tw/script.lua +++ b/locale/zh-tw/script.lua @@ -650,6 +650,8 @@ CLI_CHECK_PROGRESS = -- TODO: need translate! 'Found {} problems in {} files' CLI_CHECK_RESULTS = '診斷完成,共有 {} 個問題,請查看 {}' +CLI_CHECK_MULTIPLE_WORKERS = -- TODO: need translate! +'Starting {} worker tasks, progress output will be disabled. This may take a few minutes.' CLI_DOC_INITING = -- TODO: need translate! 'Loading documents ...' CLI_DOC_DONE = -- TODO: need translate! -- cgit v1.2.3