Page MenuHomePhabricator

Maki symbol icons could be cached
Closed, ResolvedPublic1 Estimated Story Points

Description

It looks like makizushi is only caching the alphanumeric markers, but not symbol icons. This could be a significant performance issue since every symbol render requires a file read.

We need better instrumentation in the library anyway, so this would be a good opportunity to emit metrics during maki render.

Also, caching all of the alphanumerics could be wasteful, we should try to get a memory profile of how much space this takes. It would be straightforward to replace the permanent cache with a LRU layer, if it would help.

Code to review: https://github.com/wikimedia/makizushi/pull/5

Event Timeline

Looking at webrequests, interactive maps request a pin image roughly 1.8M times per day, and the total number of maki renders must be at least 2x that number (a static map is rendered for every interactive one), probably more like 10x (many more static maps are rendered overall). Most of these rendering requests were loading the symbol icon from a file, so I imagine the load caused by this code was significant.

WMDE-Fisch set the point value for this task to 1.Aug 25 2022, 11:04 AM
WMDE-Fisch moved this task from Demo to Done on the WMDE-TechWish-Sprint-2022-08-17 board.

Reopening after the revelations in https://phabricator.wikimedia.org/T302861#8202688

Fully-rendered pins are cached by geojson-mapnikify and stored in the /tmp directory. This would probably be much better to keep in-memory and include a TTL.

WMDE-Fisch claimed this task.
WMDE-Fisch subscribed.

Reopening after the revelations in https://phabricator.wikimedia.org/T302861#8202688

Fully-rendered pins are cached by geojson-mapnikify and stored in the /tmp directory. This would probably be much better to keep in-memory and include a TTL.

I created a new task for this. T317619: Cache geojson-mapnikify icons in memory