second window - drops frames

Hi all,

I am using the code below to generate a second window that I will use as a menu in a second monitor.

        wp = WindowProperties()
        wp.setSize(1024, 768)
        #wp.setOrigin(1280, 0)
        wp.setOrigin(1024, 0)
        aspectRatio = 1024/768
        
        controlwin =base.openWindow(props = wp, aspectRatio = aspectRatio, makeCamera = 0 )

        # Setup a render2d and aspect2d for the new window.
        render2d = NodePath('render2d')
        render2d.setDepthTest(0)
        render2d.setDepthWrite(0)
        camera2d = base.makeCamera2d(controlwin)
        camera2d.reparentTo(render2d) 
       
        self.aspect2d = render2d.attachNewNode(PGTop("aspect2d"))
        #self.aspect2d.setScale(1.0 / aspectRatio, 1.0, 1.0)
        
        # Set up a MouseWatcher to monitor the DirectGui.
        name = controlwin.getInputDeviceName(0)
        mk = base.dataRoot.attachNewNode(MouseAndKeyboard(controlwin, 0, name))
        mw = mk.attachNewNode(MouseWatcher(name))
        self.aspect2d.node().setMouseWatcher(mw.node()) 

and I use somehting like this to create a button

 self.StartButton = self.Menu.createDirectbutton(self,12)

createDirectbutton is my method in menu.py class

The issue is that this menu decreases the frame rate from 60 to 15.
When I close it everything is fine.

from the pstats screenshot I can see that the most processing is under under Wait/flip/begin.

Can anyone advice why this is happening and what I have to do to fix this?

thank you

the issue was solved with those after the post of David
https://discourse.panda3d.org/viewtopic.php?t=6519&highlight=wait+pstats+problem

sync-video 0
yield-timeslice 0
client-sleep 0
multi-sleep 0