micro optimization of sampling