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.

All other Modules /

Discuss all other Modules here.

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

event_calendar


Go to End


2 Posts   1133 Views

Avatar
mattclegg

Community Member, 56 Posts

9 July 2010 at 8:37pm

Edited: 09/07/2010 8:37pm

Hi Uncle Cheese,

For some reason the event_calendar module starting working really slow for a site on a site with not many events but several calendars. But I found that by changing;

$Y = date('Y', $ts); // year

to

$Y = date('y', $ts); // year

in sfDateTimeToolkit::breakdown() made alot of difference to performance. I could run some runtime results to prove this? But in this instance it was noticeably different. Can you see any potential problem in making this change?

I also noticed (a minor thing) that the switch should be using

default:
 Debug::message(sprintf('The unit of time provided is not valid: %s', $unit));

as opposed to outputting a symphony error message.

Happy coding,

Avatar
UncleCheese

Forum Moderator, 4102 Posts

10 July 2010 at 1:42am

I can't imagine that there's a causal link between changing "Y" to "y" and increased performance, but it's good to know. First I've heard of any performance issues on EC. If you find any resources that suggest performance issues with 4-digit years, send them over. If there's any substance to it, it would be one of the strangest PHP nuances I've ever encountered.