I've finished testing the patch. I confirm that the patch solves the problem and works just as fast.
Thanks,Alexey Orlov.