dotfuscator 会降低执行速度吗?
我刚刚发现我的程序在通过 dotfuscator 社区版时执行速度下降了 5%。
这正常吗? 什么可能是 dotfuscator 的替代品(免费)但不会这样做?
I just found out that my program is losing 5% execution speed when it go through dotfuscator community edition.
is that normal? what could be an alternative(free) to dotfuscator that wouldn't do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,这是混淆的副作用。 可能还有其他一些(例如 Salamander)可以提供更好的性能,但这是混淆的副作用。
Yes, this is a side effect of obfuscation. There might be some other ones like Salamander that give better performance but this is a side effect of obfuscation.
混淆器所做的事情之一是混淆代码中的文字,特别是文字字符串。 这些文字在运行时必须是未混淆的。 字符串处理不是特别快。
One of the things an obfuscator does is obfuscate literals in your code, particularly literal strings. These literals must be un-obfuscated at runtime. String processing is not particularly fast.
由于您使用的是免费版本的 Dotfuscator,它仅执行重命名,因此您的性能问题很可能与字符串文字混淆的任何开销无关(因为该功能不在该版本中)。
如果您使用序列化并在混淆程序集之前在程序集上运行 sgen,并且不包含可能导致性能问题的 sgen 程序集。
由于较小的二进制大小和减小的字符串表大小,其本身的重命名通常对性能增强而言性能中立。 我建议的一件事是在混淆的程序上运行分析器,并尝试找到热点,这可能会给您一些线索,进入可能包含问题线索的区域。
Since you are using the free version of Dotfuscator, which only performs renaming, your performance issue is most likely not related to any overhead in the obfuscation of string literals (since that functionality is not in that version).
If you are using serialization and are running sgen on your assemblies prior to obfuscating them and not including the sgen assemblies that can cause performance issues.
On it's own renaming is normally performance neutral to performance enhancing due to smaller binary sizes and reduced string table sizes. One thing I would recommend would be to run a profiler on the obfuscated program and try to find the hotspots which may give you some leads into areas that may contain a clue to the problem.