FPS reduces when image cropping is done

I need to crop and save image using nvidia deepstream.
Its done based on the link below

But the fps reduces from 30 to 15. For each and every detected object, new nvbufsurface is allocated and this can be the reason.
Any possible solution ?