Posted by minorOffense on March 5, 2013 at 2:25am
1 follower
| Project: | Date |
| Version: | 7.x-2.x-dev |
| Component: | Date API |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
Some small tweaks to date_has_time and date_has_date to speed things up a bit.
Basically, return early when granularity isn't an array.
Second, use isset instead of array_intersect with count and a typecast.
I've included an XHProf showing the performance difference for date_has_time. A similar savings is gained from date_has_date.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| date_has_time original.png | 96.42 KB | Ignored | None | None |
| date_has_time isset.png | 81.03 KB | Ignored | None | None |
Comments
#1
Patch with optimizations.
#2