我们已经注意到,在运行时,SOAP Web服务似乎运行得更快
spring-boot:run
Run Code Online (Sandbox Code Playgroud)
而不是像我们为部署和运行那样打包JAR
java -jar mySpringApp.jar
Run Code Online (Sandbox Code Playgroud)
加速大约是2-3倍,所以很明显我们希望这对我们的现场环境来说.
为了验证这不是我们的应用程序中的东西,我已经尝试使用弹簧指南中的示例应用程序
git source https://github.com/spring-guides/gs-soap-service.git
使用JMeter进行测试显示了同样的加速速度.我已经在Windows 7 Java 1.8.0_31和Ubuntu 14.04平台上使用1.8.0_45-b14测试了这个.
这似乎只是肥皂服务的情况,简单的html并没有表现出任何显着的性能差异.知道是什么原因引起的吗?
Collections.singletonList即使列表中的值是不可变的,SonarLint 似乎也认为是可变的。这是一个错误还是规则不够智能,无法检查列表类型的可变性?
public static final List<String> STRING_LIST = Collections.singletonList("myString");
Run Code Online (Sandbox Code Playgroud)
Collections.immutableList相反,即使列表中的值是可变的,使用似乎也会消除此错误。
public static final List<Point> POINTS = Collections.unmodifiableList(Collections.singletonList(new Point(1, 2)));
Run Code Online (Sandbox Code Playgroud)
以上运行 SonarQube 6.2。