GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » cpu times
Re: cpu times [message #13486 is a reply to message #13485] Sat, 12 May 2012 11:14 Go to previous messageGo to previous message
Felix Boehmer is currently offline  Felix Boehmer
Messages: 149
Registered: May 2007
Location: Munich
first-grade participant

From: *
Dear Gianluigi,

while these are interesting measurements, I have to re-cite one those fun meetings we had last summer: You are comparing apples with pears!

If you want to compare the raw performance of the two data classes, you have to use similar functionality, e.g. the [] operator of the <vector> which does no implicit range check. It is unnecessary and bad practice to use at() in loops of the kind
for(int i=0; i<vector.size(); i++) {
meh =; //Completely unnecessary range-check
over vectors anyway.

It would be interesting to directly compare assignment and reading performance like you did by replacing at() with []. Another thing you could look at which would have some real-world relevance is to compare array[] and (*<vector-pointer>)[] performance, that is the combined performance of a necessary de-referencing with following raw access.


Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: photos and custom event generator
Next Topic: switching off the information output
Goto Forum:

Current Time: Mon Feb 26 20:03:42 CET 2024

Total time taken to generate the page: 0.01242 seconds