fix the performance bottleneck for insert operation of pybtree