optimised implementation of html_encoder #2

Merged
giacomo.cavalieri merged 1 commit from performance-improvements into trunk 2024-05-23 04:52:54 +00:00
giacomo.cavalieri commented 2024-05-10 09:16:20 +00:00 (Migrated from gitlab.com)

I've added an optimised version for both the JS and Erlang target, from some benchmarks I could notice improvements up to ~700x on the JS target. On the Erlang target performance is on par with Phoenix HTML when generating html string!

  • I've also renamed the ffi modules since that generic name could end up causing really hard to debug problems if another gleam package had an ffi module with the same name
  • Another important thing to notice is I haven't implemented the optimised version for the other two encoders, but given this implementation for html escaping it would be really straightforward to copy-paste it for the other ones as well (just a bit boring)
I've added an optimised version for both the JS and Erlang target, from some benchmarks I could notice improvements up to ~700x on the JS target. On the Erlang target performance is on par with Phoenix HTML when generating html string! - I've also renamed the ffi modules since that generic name could end up causing really hard to debug problems if another gleam package had an ffi module with the same name - Another important thing to notice is I haven't implemented the optimised version for the other two encoders, but given this implementation for html escaping it would be really straightforward to copy-paste it for the other ones as well (just a bit boring)

mentioned in commit 8431bfedd7

mentioned in commit 8431bfedd7b33b3e3411a371b42d75fda466a2fa
nicd merged commit 8431bfedd7 into trunk 2024-05-23 04:52:54 +00:00

Thank you so much! 💜 💛 💙 💚

Thank you so much! :purple_heart: :yellow_heart: :blue_heart: :green_heart:
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: nicd/glentities#2
No description provided.