HI after much research and knowing that the problem does not arise on new installations, I searched for all the old configuration files In the X11 folder /etc/X11/Xsession.d/ there were files from 2010 and trying to associate each file with the package they were installed from.. I found the file /etc/X11/Xsession.d/20desktop-profiles_activateDesktopProfiles belonging to the package desktop-profiles
I fixed it by deleting the outdated package desktop-profiles and finally it works without errors and without slowdowns! I hope it's useful for those who have old debian installations ;-) and who wisely keep upgrading bye bye Gianluca