Replies: 7 comments
-
请修改原来的报告,删除不必要的日志,使用良好的格式提交如下内容:
|
Beta Was this translation helpful? Give feedback.
-
下面是示例,请参考这样的模式报告 加密命令和环境 $ pyarmor cfg wrap_mode 1
$ pyarmor gen --assert-call foo.py
INFO Python 3.9.0
INFO Pyarmor 8.1.6 (pro), 005068, boot armor
INFO Platform darwin.x86_64 加密前性能
加密后性能
示例脚本 import sys
def sum2(a, b):
return a + b
def main(msg):
a = 2
b = 6
c = sum2(a, b)
print('%s + %s = %d' % (a, b, c))
if __name__ == '__main__':
main('pass: %s' % data) |
Beta Was this translation helpful? Give feedback.
-
$ pyarmor gen -O dist m.py INFO Python 3.11.0 输出: 加密前0.8,加密后2.5 m.py
test.py
|
Beta Was this translation helpful? Give feedback.
-
@jondy 3.11.0 环境已经补充提交, 3.8.6 环境下提示错误
|
Beta Was this translation helpful? Give feedback.
-
3.10.9 环境下提示下执行结果 (操作系统window11, 通过 scoop 安装的不同python版本)
|
Beta Was this translation helpful? Give feedback.
-
循环了 100万次,多了 1.7 秒,这个性能基本是在期望之中的。 如果对性能要求很高,请关注最新的文档更新,关于各种选项对性能影响的文档(英文版)在这周就会完成,可以参考该文档选择合适的选项。 可以先测试一下选项 |
Beta Was this translation helpful? Give feedback.
-
另外还有性能测试需要注意的一点,不管是运行原来的脚本,还是加密后的脚本,需要把所有 但是编译脚本(.py->.pyc)是很花费时间的,尤其是大脚本。 |
Beta Was this translation helpful? Give feedback.
-
新版本python下加密函数效率降低,有办法处理吗?
python3.8.6: 0.35s
python3.10.9: 3.59s
python3.11.0: 5.8.2s
下面是配置选项,三个版本的选项都是一样的:
Section: pyarmor
Current options
major = 8
minor = 1
patch = 6
core = 2.1
runtime = 2.1
timeout = 6
regurl = https://api.dashingsoft.com/pr...
buyurl = https://order.mycommerce.com/p...
Global options
Local options
Section: logging
Current options
debug_logfile = .pyarmor/pyarmor.debug.log
trace_logfile = .pyarmor/pyarmor.trace.log
Global options
Local options
Section: finder
Current options
recursive = 0
pyexts = .py .pyw
data_files = 0
findall = 0
Global options
Local options
Section: builder
Current options
encoding = utf-8
enable_trace = 0
enable_themida = 0
import_prefix = 0
bootstrap_file = file
exclude_co_names = ...
exclude_restrict_modules = init
outer_keyname = pyarmor.rkey
inline_plugin = 1
jit_iv_threshold = 100
rft_enables = builtin import function class ...
rft_auto_exclude = 1
rft_auto_export = 1
rft_dev_mode = 0
optimize = 1
type_comments = false
trace_rft = 0
enable_jit = 0
enable_bcc = 0
enable_rft = 0
assert_call = 0
assert_import = 0
mix_str = 0
mix_coname = 0
mix_localnames = 1
mix_argnames = 0
obf_module = 1
obf_code = 1
wrap_mode = 1
restrict_module = 1
import_check_license = 0
clear_module_co = 1
clear_frame_locals = 0
rft_mix_import_name = 0
Global options
Local options
Section: runtime
Current options
universal = 0
simple_extension_name = 1
outer = 0
on_error = 0
nts = pool.ntp.org
nts_timeout = 3
timer = 0
messages = messages.cfg:utf-8
Global options
Local options
Section: pack
Current options
strip = 0
other_pyc = 0
no_matched_pyc = error
Global options
Local options
Section: bcc
Current options
unsupported_functions = exec eval super locals __asser...
unsupported_nodes = AsyncFunctionDef AsyncFor Asyn...
call_function_ex = 0
trace_lineno = 0
keep_nest_name = 0
ignore_lambda = 0
enable_pure_function = 1
enable_comprehension = 1
Global options
Local options
Section: mix.str
Current options
enables = all
threshold = 4
Global options
Local options
Section: assert.call
Current options
enables = all
Global options
Local options
Section: assert.import
Current options
enables = all
Global options
Local options
Beta Was this translation helpful? Give feedback.
All reactions