Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Dataobject best practice


Go to End


5 Posts   1817 Views

Avatar
Mo

Community Member, 541 Posts

18 June 2009 at 1:29am

Does anyone know if there is a recommended limit to the amount of usage of DataObject::get that can be used during one page load (for optimal performance)?

Cheers,

Mo

Avatar
Hamish

Community Member, 712 Posts

18 June 2009 at 8:45am

That is really a 'how long is a stick' question - it depends on what you're doing. If you're having trouble with performance, it might be that you can simplify your database structure or put in some optimisations (for example, saving some common data between relationships on write, rather than pulling the data on read).

If you want an 'out of the box' (sort of) performance module, have a look at the 'static publisher' module. It allows you to rsync the generated pages to your internet-facing site.

Avatar
Mo

Community Member, 541 Posts

18 June 2009 at 10:58am

I'm not really getting any performance issues, I was just kind of wondering if there was anything I could work to productively.

Avatar
Hamish

Community Member, 712 Posts

18 June 2009 at 11:01am

Usual rule of thumb is: "Avoid premature optimization". Once everything is working as it should, then you can use the profiler to see if there are some 'quick wins' to be made by combining queries or whatever.

Avatar
Mo

Community Member, 541 Posts

18 June 2009 at 11:06am

I think thats probably a good rule of thumb to work to :),

Cheers