Such a great difference looks strange to me: I never saw those figures.
If you run a project in the 5.5 IDE environment, the debug features are all active, unless you set in the project window Build >> Configuration >> Release.
Up to 5.0 version the corresponding option was in Options >> Run options menu, and could be set to 'None'.
Check in your project if this option is turned on or off (remember that when you compile a project, it is automatically set to 'None'): such a different configuration (5.5 WITH debugging and 4.0 without) could perhaps explain the graeat difference in performance.
Hope this helps
Roberto