Make great documentation goal 1.2, and plan the README's reorganisation and the nested-template gaps #33
@@ -398,6 +398,10 @@ CI load, while time varies with the machine and its neighbours. A rendering slow
|
|||||||
almost always costs an allocation too (a lost pre-size, a per-item map, an extra copy).
|
almost always costs an allocation too (a lost pre-size, a per-item map, an extra copy).
|
||||||
The benchmark suite (the README's Development) reports time for a human, not as a pass/fail gate.
|
The benchmark suite (the README's Development) reports time for a human, not as a pass/fail gate.
|
||||||
|
|
||||||
|
A case guarding against one allocation per render, such as a render's scope reaching the
|
||||||
|
heap through `pickKey.under`, holds at its baseline with no margin, since 10% of its
|
||||||
|
count is less than one allocation. Lilleman auf Larv decided it on 2026-10-06.
|
||||||
|
|
||||||
## Rows live in a TSV, the shape in JSON
|
## Rows live in a TSV, the shape in JSON
|
||||||
|
|
||||||
2026-09-17, Lilleman auf Larv. Goals 8 and 13.
|
2026-09-17, Lilleman auf Larv. Goals 8 and 13.
|
||||||
|
|||||||
+7
-7
@@ -59,12 +59,12 @@ func TestNoRenderAllocRegression(t *testing.T) {
|
|||||||
func TestNoReferenceAllocRegression(t *testing.T) {
|
func TestNoReferenceAllocRegression(t *testing.T) {
|
||||||
word := `{"format":"{w}","w":["alpha","beta","gamma","delta"]}`
|
word := `{"format":"{w}","w":["alpha","beta","gamma","delta"]}`
|
||||||
for _, s := range []struct {
|
for _, s := range []struct {
|
||||||
name, json string
|
name, json string
|
||||||
base float64
|
base, slack float64
|
||||||
}{
|
}{
|
||||||
{"a repeat of a reference path", `{"format":"{r}","r":{"format":"{/word.w}","repeat":20,"separator":", "}}`, 25},
|
{"a repeat of a reference path", `{"format":"{r}","r":{"format":"{/word.w}","repeat":20,"separator":", "}}`, 25, 1.10},
|
||||||
{"a repeat of a name", `{"format":"{r}","r":{"format":"{/word as n}{n.w}{n.w}","repeat":20,"separator":", "}}`, 162},
|
{"a repeat of a name", `{"format":"{r}","r":{"format":"{/word as n}{n.w}{n.w}","repeat":20,"separator":", "}}`, 162, 1.10},
|
||||||
{"a read two levels under a pick", `{"format":"{place.geo as g}{g} {g.town.zip}","place":{"format":"{geo}","geo":{"format":"{town.zip}","town":{"format":"{zip}","zip":"1"}}}}`, 12},
|
{"a read two levels under a pick", `{"format":"{place.geo as g}{g} {g.town.zip}","place":{"format":"{geo}","geo":{"format":"{town.zip}","town":{"format":"{zip}","zip":"1"}}}}`, 12, 1},
|
||||||
} {
|
} {
|
||||||
f, err := New(WithoutShippedData(), WithDataFS(fstest.MapFS{
|
f, err := New(WithoutShippedData(), WithDataFS(fstest.MapFS{
|
||||||
"word.json": {Data: []byte(word)},
|
"word.json": {Data: []byte(word)},
|
||||||
@@ -73,8 +73,8 @@ func TestNoReferenceAllocRegression(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("New(%s): %v", s.name, err)
|
t.Fatalf("New(%s): %v", s.name, err)
|
||||||
}
|
}
|
||||||
if allocs := testing.AllocsPerRun(10000, func() { f.Fake("x") }); allocs > s.base*1.10 {
|
if allocs := testing.AllocsPerRun(10000, func() { f.Fake("x") }); allocs > s.base*s.slack {
|
||||||
t.Errorf("%s: %.1f allocs/op regressed past %.1f (baseline %.1f + 10%%); a render's scope reaching the heap is the usual cause", s.name, allocs, s.base*1.10, s.base)
|
t.Errorf("%s: %.1f allocs/op regressed past %.1f (baseline %.1f × %.2f); a render's scope reaching the heap is the usual cause", s.name, allocs, s.base*s.slack, s.base, s.slack)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user