Files
TransPyC/lib/Projectrans/__init__.py
T
TermiNexus 15e8bc7c7d refactor(compile): 完全去除多进程,翻译/编译全部改顺序阻塞执行
ProcessPoolExecutor 批次/波次子任务模型导致跨模块 struct 类型前缀错位
(7cadfe07e983fd90.Translator != 6ccfee1e5bd522ed.Translator,见 1.log),
且 cProfile 墙钟被进程池等待支配(223s 中 173s 耗在 WaitForMultipleObjects)。
删除 _parallel_translate_worker/_parallel_translate_batch、_executor_pool
及两处 llc ThreadPoolExecutor,App/includes 翻译按依赖拓扑顺序阻塞翻译,
llc 编译逐文件阻塞执行,消除 pickle 序列化共享符号表与进程池等待开销。
2026-08-17 20:22:45 +08:00

32 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Projectrans 包 - 工程级 TransPyC 翻译器"""
import lib._bootstrap # noqa: F401 设置 sys.path(项目根 + lib/includes)
from lib.core.VLogger import Logger, LogLevel, set_logger
# 创建全局日志实例(仅控制台输出,不落盘,避免生成 build.log)
logger = Logger(
name="TransPyC",
level=LogLevel.INFO,
use_colors=True
)
set_logger(logger)
from lib.Projectrans.Utils import (
compute_sha1, _check_annotation_for_export, sha1_file,
get_file_dependencies, find_reachable_files_from_entries,
topological_sort_files
)
from lib.Projectrans.Phase1Generator import Phase1Generator
from lib.Projectrans.DeclarationGenerator import DeclarationGenerator
from lib.Projectrans.Phase2Translator import Phase2Translator
from lib.Projectrans.Config import save_sha1_map, Load_sha1_map, get_sha1_map_store, clear_sha1_map_store, Load_project_config, resolve_paths, main
__all__ = [
'compute_sha1', '_check_annotation_for_export', 'sha1_file',
'get_file_dependencies', 'find_reachable_files_from_entries',
'topological_sort_files', 'Phase1Generator', 'DeclarationGenerator',
'Phase2Translator',
'save_sha1_map', 'Load_sha1_map', 'get_sha1_map_store', 'clear_sha1_map_store',
'Load_project_config', 'resolve_paths', 'main'
]