Duplicate of #4161 for milestone 2.4.21
Profiling point queries using
var entity = ds.find(Entity.class).filter(eq("id", id)).first();
shows that ~10 % of CPU time is spent throwing NotMappableException when the filter is being mapped to org.bson.Document. This patch should reduce the overhead.
Flame graph of point query execution, highlighting the stack traces which contain new NotMappableException(type):
