frame allocs: a click is not a frame, a reducer is its dispatch's, a capped push is bounded; ludic.photo at 0
The analysis made every component function a frame root, event handlers (cmp_x_on_delete) too, and every reducer, whether its action is dispatched every frame or once a trip: a component's 'on' handlers are no longer roots, and a dispatch is an edge to its action's reducers, so a reducer counts only when frame code dispatches it. A push into a field declared @max(n) is bounded by the fence's own check and no longer counted. Maroon Lake: frame_allocs 395 -> 337, frame_keeps 188 -> 169. ludic.photo: the roll's order and a page of it are kept lists refilled in place (the pack's page asked for both every frame), its kept lists say @max(256), and a shot's tags, a photograph's fact and a new roll are declared (once per shot, sale or trip). 18 allocs and 9 keeps -> 0 and 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5be2422c84
commit
3b9b4a589b
7 changed files with 58578 additions and 57763 deletions
|
|
@ -29,7 +29,8 @@ export property PhotoFact {
|
|||
export state PhotoState {
|
||||
pht_sort: int = 0
|
||||
pht_page: int = 0
|
||||
pht_order: []int = null
|
||||
@max(256) pht_order: []int = new []int # the roll's order, refilled in place (a page asks it every frame)
|
||||
@max(8) pht_page_out: []int = new []int # a page of it, the same
|
||||
pht_max: int = 40
|
||||
pht_n: int = 0
|
||||
pht_day: []int = null
|
||||
|
|
@ -39,8 +40,8 @@ export state PhotoState {
|
|||
pht_sold: []int = null
|
||||
pht_grade: []int = null
|
||||
pht_why: []int = null
|
||||
pht_tags: []string = null
|
||||
pht_file: []string = null
|
||||
@max(256) pht_tags: []string = null
|
||||
@max(256) pht_file: []string = null
|
||||
pht_best: []int = null # the best grade yet, per subject
|
||||
pht_species_shot: int = 0 # every subject ever photographed, sold or deleted
|
||||
pht_legend_shot: int = 0
|
||||
|
|
@ -63,6 +64,7 @@ export function photo_facts(photo_st: PhotoState) -> Queue<PhotoFact> {
|
|||
return photo_st.pht_fact_q
|
||||
}
|
||||
|
||||
@alloc_ok("a photograph's fact: one per shot kept, sold or deleted")
|
||||
function pht_fact(photo_st: PhotoState, what: int, i: int) -> PhotoFact {
|
||||
let f = new PhotoFact
|
||||
f.what = what
|
||||
|
|
@ -84,6 +86,7 @@ function pht_floats(n: int) -> []float {
|
|||
}
|
||||
|
||||
# an empty roll of `max` frames
|
||||
@alloc_ok("a new roll: once a trip, and when the roll is emptied")
|
||||
function pht_blank(photo_st: mut PhotoState) -> void {
|
||||
photo_st.pht_n = 0
|
||||
photo_st.pht_day = pht_ints(photo_st.pht_max)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue