-
Author
Tagged: performance
-
June 12, 2015 at 11:44 #62326marius_gParticipant
During a page load kleo_icons_array() is called many many times.
Every time it is called it loads a large JSON from the file system and parses it with json_decode. It should be cached, only loaded once.
COPY CODEfunction kleo_icons_array() { $icons= array(''); $icons_json = file_get_contents( KLEO_LIB_DIR . '/assets/font-icons.json'); if ($icons_json) { $arr = json_decode($icons_json, true); foreach($arr['glyphs'] as $icon) { $icons[$icon['css']] = $icon['css']; asort($icons); } } return $icons; }
The calls to kleo_icons_array() consumes 13% of the time it takes to produce the html page(!). According to New Relic APM trace attached.
So optimizing this function could be the best performance enhancement ever 🙂
Please prioritize this!
Thanks!
MariusAttachments:
You must be logged in to view attached files.June 12, 2015 at 18:03 #62410AbeKeymasterhi, I will definitely take a look and let you know the solution. Thank you
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.June 13, 2015 at 01:43 #62545AbeKeymasterWe are releasing an update now with an improvement on this matter also. we added a transient for it so it is calculated just once.
Thank you for letting us know
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.June 16, 2015 at 16:08 #63133marius_gParticipantDeployed the latest version and immediately saw a 200ms improvement in serving the html page. Nice!
Attachments:
You must be logged in to view attached files.June 16, 2015 at 16:27 #63137AbeKeymasterAwesome. Glad to hear that.
Thanks
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer. -
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.