discourse/app/assets/javascripts/discourse-common/addon/lib
David Taylor 135fdd59ed
PERF: Improve JS app boot speed by optimizing customResolve() (#14990)
Time spent in the 'find module with suffix' portion of our `customResolve` function were adding up to around 100ms-150ms when booting the app. This time is spread over 150+ calls, so it's not immediately obvious in flamegraphs.

This commit implements a (reversed) [Trie](https://en.wikipedia.org/wiki/Trie) which enables fast suffix-based lookups on a list of strings.

In my tests, this requires < 5ms to initialize, and brings the cumulative 'find module with suffix' time down to `< 5ms`. This corresponds to a ~100ms improvement in LCP metrics in my browser.

The only behavior change is to remove support for module filenames which are **not** dasherized. I haven't found any core/theme/plugin modules which are not dasherized in their filenames.
2021-11-18 16:38:00 +00:00
..
attribute-hook.js DEV: prettier 2.2.1 (#11862) 2021-01-27 12:39:20 +01:00
debounce.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
deprecated.js
escape.js FIX: Escape Font Awesome icons (#12421) 2021-03-17 16:11:40 +03:00
get-owner.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
get-url.js FIX: Some absolute links were causing full page reloads (#13377) 2021-06-15 12:30:36 +10:00
helpers.js DEV: prettier 2.2.1 (#11862) 2021-01-27 12:39:20 +01:00
icon-library.js DEV: Allow replacing share icons separately (#14774) 2021-10-29 13:35:27 -04:00
object.js DEV: prettier 2.2.1 (#11862) 2021-01-27 12:39:20 +01:00
raw-handlebars-helpers.js FIX: Tests were broken in Firefox (#12456) 2021-03-22 11:35:51 +11:00
raw-handlebars.js DEV: prettier 2.2.1 (#11862) 2021-01-27 12:39:20 +01:00
raw-templates.js FIX: Core templates should never overwrite theme/plugins (#12988) 2021-05-07 14:41:06 -04:00
suffix-trie.js PERF: Improve JS app boot speed by optimizing customResolve() (#14990) 2021-11-18 16:38:00 +00:00