Massive insert performance optimizations

Still need to do some more optimizations for onRetrieved to further
reduce overhead, but it's back to acceptable levels.
Fixed benchmark test
3.3.0