Here's a bit I'm maintaining in the D&D_OED character sheet script, to add up encumbrance values. There are 40 text fields titled attr_enc_1 , etc. // Gather encumbrance fields const items = []; for ( i = 1; i <= 40; i++ ) { items.push( 'enc_' + i ); } // Compute total encumbrance items.forEach( item => { on( `change:${item} sheet:opened`, () => { var total = 0; getAttrs( items, values => { items.forEach( enc => { total += (parseFloat( values[enc] ) || 0); }); setAttrs({total_enc: total}); }); }); }); The thing I notice here is a particular inefficiency: on sheet:opened, it seems that this script will re-compute the total encumbrance 40 times over (once for each item in the array, due to the outer forEach loop; i.e., 1600 total additions). Right? I can detect a bit of a hiccup-delay when the sheet loads as a result. I've tried a few things (e.g., an initial scan and setting a "needToRecompute" variable then an if statement), but nothing I'm trying seems to work. What the best way to make this efficient, and just compute the total once any time either sheet:opened or any change:enc_X occurs?