You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This does not take advantage of Phoenix's template compilation for faster rendering.
Todo
refactor template to badge.svg.eex
render using render(conn, "badge.svg", count)
apply gzip compression for even faster rendering
Note: rendering is not currently a "bottleneck" in the app,
the DB query is orders of magnitude slower than String.replace.
This optimisation should be considered after ETS is implemented for caching the count.
The text was updated successfully, but these errors were encountered:
nelsonic
changed the title
Performance Optimisation: Use EEX Template for SVG Rendering
Perf Optimisation: Use EEX Template for SVG Rendering
May 17, 2019
Using the String.replace method, the response time on localhost is around 500µs:
That's µsnotms ... 500 microseconds ... 500 millionths of a second.
We can definitely speed this up, and it would be good to do a more scientific benchmark of response times ... but I don't think any one is going to complain about this response time. 😉
Still if you have time to help refactor this, please dive in! 💻
At present we have a 511 Byte
template.svg
file which we are manuallyString.replace
-ing the{count}
in:This does not take advantage of Phoenix's template compilation for faster rendering.
Todo
badge.svg.eex
render(conn, "badge.svg", count)
The text was updated successfully, but these errors were encountered: