简体   繁体   English

lombok builder和lombok no//allargsconstructor annotation之间的性能哪个更好

[英]Which one is better on performane between lombok builder and lombok no//allargsconstructor annotation

Which one is better in peformance comparing between lombok builder and lombok no//allargsconstructor annotation when creating objects?在创建对象时,lombok builder 和 lombok no//allargsconstructor 注释之间的性能比较哪个更好?

Amount.builder().categoryCode("A").coveredAmount(new 
BigDecimal(100)).build();

or或者

Amount cva1 = new Amount();
cva1.setCoveredAmount(new BigDecimal(100));
cva1.setCategoryCode("A");

or或者

Amount cva1 = new Amount(new Bigdecimal(100), "A");

Lombok is a compile-time-only tool and so has nothing to do with runtime performance. Lombok 是一个仅编译时的工具,因此与运行时性能无关。

It is an annotation processor that run during the java compilation javac .它是在 java 编译javac期间运行的注释处理器。

Here you only want to compare creational patterns but it not something "link" to Lombok.在这里,您只想比较创建模式,而不是与 Lombok 的“链接”。

By the way it is opinion-based顺便说一句,它是基于意见的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM