significantly increase performance on 32 bit jvms

@yilongli please  review