Jump to:

10930 Posts in 2613 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » event_calendar

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 793 Views
  • mattclegg
    Avatar
    Community Member
    56 Posts

    event_calendar Link to this post

    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,

  • UncleCheese
    Avatar
    4085 Posts

    Re: event_calendar Link to this post

    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.

    793 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.