- Issue created by @tobiasb
I investigate why our view with many dates needs so much time. And I saw that
\Drupal\Core\Datetime\DateFormatter::dateFormat
via \Drupal\Core\Datetime\DateFormatter::format
was called very often.
\Drupal\smart_date\SmartDateTrait
use \Drupal\Core\Datetime\DateFormatter::format
.
\Drupal\Core\Datetime\DateFormatter::dateFormat
is called when it is not type custom.
, but \Drupal\smart_date\SmartDateTrait
set this to empty string, which results into unnecessary calls.
See attached screenshots, before and after the fix.
-
Set missing date time type to custom.
-
-
-
-
Active
4.2
Code
It affects performance. It is often combined with the Needs profiling tag.