perf: replace string concatenation with list join and add normalized headers map in html, http, jinja, json, markdown modules
Optimize string building in decodeUtf8_, slugify, parseRaw_, processCode_, and processBold_ by accumulating parts in a list and joining once, avoiding repeated string allocation. In HttpResponse constructor, precompute a normalized headers map for O(1) case-insensitive header lookups instead of linear scan. Simplify Json.stringify indent generation using string repetition operator.
This commit is contained in:
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "html" for Html
|
||||
|
||||
var long = "A" * 10000
|
||||
var result = Html.slugify(long)
|
||||
System.print(result.count) // expect: 10000
|
||||
Reference in New Issue
Block a user