| I am having some performance issues with caching lazily-initialized LOBs. A large amount of time (>25% of total time according to JMC) is spent trying turn the byte[] into a String. Some of our byte[]s can be several MBs large, and this is hurting performance more than caching them improves performance in the first place. I thought this could be related to https://hibernate.atlassian.net/browse/HHH-11097 but we are using 5.2.13. I have attached the stack trace in the images below. My entity class, which is lazily loaded, is below:
@Entity
public class Payload {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Lob
@Column(length = Integer.MAX_VALUE)
private byte[] payload;
public Payload() {}
public Payload(byte[] payload){
super();
this.payload = Arrays.copyOf(payload, payload.length);
}
public byte[] getPayload() {
return payload;
}
public void setPayload(byte[] payload) {
this.payload = Arrays.copyOf(payload, payload.length);
}
}
|