Thats kind of a lot of code to read through. eg hard to confirm visually things like it is in the CPU. Question: are the costs you are getting similar? Or is eg .data[0] case giving weird, uninitialized values? (or, eg, always the same value?) what happens if you print both, and try printing first .data[0] and then .item(), and also try the other way around?