Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LocaleSerializeJMHMain2 {
- private static Locale locale = Locale.UK;
- {
- locale.toLanguageTag();
- }
- @Benchmark
- public String localeToString() {
- return locale.toString();
- }
- @Benchmark
- public String localeToLangTag() {
- return locale.toLanguageTag();
- }
- @Benchmark
- public String localeToLangTagWithVersion() {
- return locale.toLanguageTag() + "@";
- }
- public static void main(String[] args) throws RunnerException {
- Options options = new OptionsBuilder()
- .include(LocaleSerializeJMHMain2.class.getSimpleName())
- .warmupIterations(50)
- .forks(1)
- .build();
- new Runner(options).run();
- }
- }
- // ----------------------------------------------------------------------------------------------------------
- Benchmark Mode Cnt Score Error Units
- LocaleSerializeJMHMain2.localeToLangTag thrpt 20 272830686,501 ± 11221808,760 ops/s // ±4%
- LocaleSerializeJMHMain2.localeToLangTagWithVersion thrpt 20 21061628,116 ± 983160,887 ops/s // ±5%
- LocaleSerializeJMHMain2.localeToString thrpt 20 19535473,189 ± 1023500,615 ops/s // ±5%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement