Xojo Conferences

« c't kompakt Programmi… | Home | Filemaker Conference … »

App.PropertyName can be very slow

Did you know that access to properties in the app object is more than 1000 times slower than accessing the same property in a module?

My testing shows that accessing app calls internally a function App which calls a function GetAppObject. Both spend a lot of CPU time for stack checking, cast checking and background tasks.

To move methods and properties from app to a module, you should create a module in your project and save the project in the text format. There you can simply copy & paste all your methods and properties in big chunks.

Here my test project:

Also I made a feedback report: case 16764. Please sign on if that is of interest for you.
26 04 11 - 19:11
one comment

I just adjusted your example to test a class as well and found similar times to access the property on a module. I imagine this would be as expected.

I added a class TimeClass and a property TimeClass.TimeC as integer. On Ubuntu Linux, the times I received were 880 app / 105 module / 109 class ticks.
Kevin Cully (URL) - 29 04 11 - 17:09

Remember personal info?

Emoticons / Textile

Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.