From a9918303b6ad8354a60920dd5adc6b0438455b2d Mon Sep 17 00:00:00 2001 From: awwaawwa <8493196+awwaawwa@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:56:44 +0800 Subject: [PATCH] perf(high_level): Set `thread` to 3 times `qps` when creating the cache. --- pdf2zh/high_level.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf2zh/high_level.py b/pdf2zh/high_level.py index d4d63de9..4e7573b5 100644 --- a/pdf2zh/high_level.py +++ b/pdf2zh/high_level.py @@ -375,7 +375,7 @@ def translate( if file.startswith(tempfile.gettempdir()): os.unlink(file) generate_cache_start = time.time() - with concurrent.futures.ThreadPoolExecutor(max_workers=thread) as executor: + with concurrent.futures.ThreadPoolExecutor(max_workers=thread * 3) as executor: translate_stream( s_raw, envs=kwarg.get("envs", {}),