setting viewport is slowing down my drawing time by half

im using opengl in a thread to render to my window. its rendering fine while im not resizing my window, so the problem is with this if statement in my render loop whenever i resize my window it is causing my render loop to be half the speed just with these functions getting called

        if (resizeFlag)
            glViewport(0, 0, clientWidth, clientHeight);


            glTranslatef(-1.0f, -1.0f, 0);
            glScalef(2.0f / clientWidth, 2.0f / clientHeight, 1);

            glTranslatef(2.0f, 2.0f, 0);

            resizeFlag = false;