I’m wondering which would be faster, or if there is ANY difference one should expect in speed between the two (assuming a large-scale project with potentially hundreds of objects to sort through/process):
class ObjectManager {
for(i = 0; i< numOfObjects; i++){
processObject(i);
renderObject(i):
}
}
–Processing then immediately rendering each object in sequence…
or
class ObjectManager {
for(i = 0; i < numOfObjects; i++){
processObject(i);
}
for(i = 0; i < numOfObjects; i++) {
renderObject(i):
}
–processing each object in sequence, then rendering them all straight through.
Also, is there ANY reason to do one over the other? Or is this the wholely wrong way to do it overall? Perhaps should the processing and rendering be seperated into different asynchronous threads? I’m not terribly familira with what sorts of things tend to work faster or not.
–Lareon
PS: Sorry if this is a repeat question, but a peripheral search through the archives presented me with nothing that looked like what I’m asking.