tildeio / htmlbars

A variant of Handlebars that emits DOM and allows you to write helpers that manipulate live DOM nodes
MIT License
1.61k stars 193 forks source link

[PERF] Don't Attempt To Sanitize Unsanitizeable #429

Open chadhietala opened 8 years ago

chadhietala commented 8 years ago

This adds an identity check for falsy values before the value is sanitized. Currently we do work to sanitize things like undefined.

This is from a bench of a thousand link-tos Before:

screen shot 2015-10-07 at 11 56 21 am

After:

screen shot 2015-10-07 at 11 56 45 am
stefanpenner commented 8 years ago

such Unsanitiveable

stefanpenner commented 8 years ago

needs señor tests.

chadhietala commented 8 years ago

Not really sure how to test this as the sanitization function is local. Not sure how helpful the test is.