package Ġde . h anno . struct . benchmark . de . h anno . struct . benchmark . kotlin čĊč Ċ import Ġde . h anno . struct . Struct Array č Ċ import Ġde . h anno . struct . benchmark . Simple Mutable Struct č Ċ import Ġde . h anno . struct . benchmark . Simple Struct č Ċ import Ġde . h anno . struct . benchmark . Struct Benchmark č Ċ import Ġde . h anno . struct . benchmark . Struct Benchmark . LIST _ SIZE č Ċ import Ġde . h anno . struct . forEach č Ċ import Ġorg . openjdk . j mh . annotations . Benchmark č Ċ import Ġorg . openjdk . j mh . annotations . Fork č Ċ import Ġorg . openjdk . j mh . annotations . Measurement č Ċ import Ġorg . openjdk . j mh . annotations . Scope č Ċ import Ġorg . openjdk . j mh . annotations . State č Ċ import Ġorg . openjdk . j mh . annotations . W arm up č Ċ import Ġorg . openjdk . j mh . infra . Black hole čĊč Ċ @ State ( Scope . Thread ) č Ċ open Ġclass ĠIterate And Mutate Struct Array State Ġ{ čĊĠĠĠ Ġ@ Jvm Field Ġval Ġstruct Array Ġ= ĠStruct Array ( LIST _ SIZE ) Ġ{ ĠSimple Mutable Struct () Ġ} č Ċ } čĊč Ċ @ State ( Scope . Thread ) č Ċ open Ġclass ĠIterate And Mutate Struct Array Indexed State Ġ{ čĊĠĠĠ Ġ@ Jvm Field Ġval Ġstruct Array Ġ= ĠStruct Array ( LIST _ SIZE ) Ġ{ ĠSimple Mutable Struct () Ġ} č Ċ } čĊč Ċ @ State ( Scope . Thread ) č Ċ open Ġclass ĠIterate Struct State Ġ{ čĊĠĠĠ Ġ@ Jvm Field Ġval Ġstruct Array Ġ= ĠStruct Array ( LIST _ SIZE ) Ġ{ ĠSimple Struct () Ġ} č Ċ } čĊč Ċ fun Ġiterate And Mutate Struct Array ( hole : ĠBlack hole , Ġstate : ĠIterate And Mutate Struct Array State ) Ġ{ čĊĠĠĠ Ġstate . struct Array . forEach ( false ) Ġ{ Ġstruct : ĠSimple Mutable Struct Ġ-> čĊĠĠĠĠĠĠĠ Ġstruct . a Ġ= Ġstruct . a Ġ+ Ġ 1 čĊĠĠĠĠĠĠĠ Ġstruct . b Ġ= Ġstruct . b Ġ+ Ġ 2 čĊĠĠĠĠĠĠĠ Ġstruct . c Ġ= Ġstruct . c Ġ+ Ġ 3 čĊĠĠĠĠĠĠĠ Ġhole . consume ( struct ) čĊĠĠĠ Ġ} č Ċ } čĊč Ċ fun Ġiterate And Mutate Struct Array Indexed ( hole : ĠBlack hole , Ġstate : ĠIterate And Mutate Struct Array Indexed State ) Ġ{ čĊĠĠĠ Ġfor Ġ( i Ġin Ġ 0 Ġuntil Ġstate . struct Array . size ) Ġ{ čĊĠĠĠĠĠĠĠ Ġval Ġstruct Ġ= Ġstate . struct Array . get AtIndex ( i ) čĊĠĠĠĠĠĠĠ Ġstruct . a Ġ= Ġstruct . a Ġ+ Ġ 1 čĊĠĠĠĠĠĠĠ Ġstruct . b Ġ= Ġstruct . b Ġ+ Ġ 2 čĊĠĠĠĠĠĠĠ Ġstruct . c Ġ= Ġstruct . c Ġ+ Ġ 3 čĊĠĠĠĠĠĠĠ Ġhole . consume ( struct ) čĊĠĠĠ Ġ} č Ċ } čĊč Ċ fun Ġiterate Struct ( hole : ĠBlack hole , Ġstate : ĠIterate Struct State ) Ġ{ čĊĠĠĠ Ġstate . struct Array . forEach ( false ) Ġ{ Ġstruct : ĠSimple Struct Ġ-> čĊĠĠĠĠĠĠĠ Ġhole . consume ( struct . a ) čĊĠĠĠĠĠĠĠ Ġhole . consume ( struct . b ) čĊĠĠĠĠĠĠĠ Ġhole . consume ( struct . c ) čĊĠĠĠ Ġ} č Ċ }