我在阅读基准测试时遇到了这些术语。我不清楚它们的确切含义。据我了解,微基准测试是对应用程序的一个非常小的功能进行基准测试。在 Java 编程中,一个例子就是 HashMap 的性能。 宏观基准更多地处于应用程序级别,基于客户的需求。 按照我的示例,宏基准测试将对缓存应用程序进行基准测试。
任何人都可以阐明这一点并验证我所理解的是否正确吗?
最佳答案
你的解释几乎涵盖了它:
摘要由 Rachasatish 提供并取自他的 blog 1
Micro-benchmarks (repeatable sections of code) can be useful but may not represent real-world behavior. Factors that can skew micro-benchmark performance include Java virtual machine warm-up time, and global code interactions.
Macro-benchmarks (repeatable test sequences from the user point of view) test your system as actual end users will see it.
这再次摘自以下书籍章节2:
- “Java 平台性能”的第 3 章“测量就是一切”。作者 Steve Wilson 和 Jeff Kesselman,Publisher Sun。
1 这是一篇关于“Java 性能调优技巧”的非常详尽的博客文章(即每个主题的一长串摘要)
2 原来是哪里link似乎指向
关于Java:宏观和微观基准之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9104465/