Disruptor与BlockingQueue压力测试性能对比
欢迎关注作者博客
简书传送门
1、先熟悉下什么是阻塞队列!
2、代码压测
2.1、公共部分
package com.bfxy.disruptor.ability;
public interface Constants {
int EVENT_NUM_OHM = 100000000;
int EVENT_NUM_FM = 50000000;
int EVENT_NUM_OM = 10000000;
}
package com.bfxy.disruptor.ability;
import java.io.Serializable;
public class Data implements Serializable {
private static final long serialVersionUID = 2035546038986494352L;
private Long id ;
private String name;
public Data() {
}
public Data(Long id, String name) {
super();
this.id = id;
this.name = name;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
2.2、ArrayBlockingQueue压测
package com.bfxy.disruptor