Does Node.sharedCopy() improve performance?

Hi Xith folks!

I just wonder, if sharedCopy() if used have any effect on performance in general? Does it helps in rendering at all?
In other words if I have loaded 10 same models individualy, is the performance worse than in case when I loading one model and then adding 9 its shared copies to scena-graph.

The only thing which is clear from the method description is that : “If you are loading the same model many times then this can save on memory and load times.” But what about performance - no effect?

I just get confused a bit because I have tried once to use sharedCopy, and as far as I concern I did noticed difference in performance. But now when I trying to check again… I don’t see any difference… So either I do something wrong now, or made wrong conclusion before :))

Will appreciate if somebody clear my worries :))

Sincerely,
Bohdan.

IMHO, I think it don’t improves performance.
I don’t see the difference (for processing time) between reading 10 times the same memory area rather than reading 10 different memory areas.
Practical (and “real”) benchs may help

I don’t think it improves performance either, although it may have a slight benefit. The main benifits are load time and memory as you have noted and it is WELL worth using for that.

Ultimately with the copy you still have to render the triangles on the screen the second time regardless of whether they have been rendered once before.

Will.

Thanks very much guys for explanation! Yes, I was suspecting so… Of caurse you are right, it couldn’t do any help for rendering itself… stupid of me… :slight_smile:

I just tried it some time ago, and noticed the difference… but most likely just something went wrong when I was using individual models rather then copies… that is why I got poor performance in first case… Moreover I couldn’t repeat my experience again anymore… actually that is why I get confused and asked the question. Now it is clear.

Ok then, thanks a lot!!

Bohdan.

If you create loads of objects -> more memory gets used -> the garbage collect might have to be run more often -> less performance

It is a good point actually, arne!

Thanks,
Bohdan