Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在将日志记录添加到现有源代码(大型源代码)中以提供详细的日志记录,我们决定了日志记录的后端(使用 facebook scribe,并经过测试)。我正在考虑使用面向方面的方式将日志调用添加到所有函数中(开始)
这是使用 AspectJ 处理日志收集的好方法吗,它对系统的性能有什么影响。
玛尼
AspectJ 本身增加的性能开销可以忽略不计(假设您将使用构建时编织)。显然,日志记录将有其自身的性能影响,这取决于您的日志记录的宽度(连接点的数量)和深度(记录的信息)。
换句话说,通过 AspectJ 添加的日志记录与等效的手动实现代码之间的性能差异可以忽略不计。