yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00702
Re: goReverse
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Thu, 2 Oct 2008 16:39:32 +0200
-
Cc:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
Face:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
-
In-reply-to:
<48E4A31B.4090305@arcig.cz>
Václav Šmilauer said: (by the date of Thu, 02 Oct 2008 12:31:55 +0200)
> Hi (Janek),
>
> do you think it would be possible for the 2d metaengines to not accept
> both combinations of types, but only one? To put it straight: facet
> (/box etc) and sphere can create two interactions, with
>
> 1. id1=Facet, id2=Sphere
> 2. id1=Sphere, id2=Facet
>
> For the case 1., IFacet2IS4SCG::go is called, which is just fine.
> However, for the second case, we call goReverse, which in turn calls
> ::go and then swaps a some variables. The swapping happens at _every
> iteration_.
>
> My point, therefore, would be to mandate type order for 2d metaengines
> -- the collider could, when creating new the interaction, swap ids
> easily, so that they would be always in the order expected by the
> metaengine. Or - perhaps better, since collider knows nothing about
> types, swap them in the MetaEngine
>
> I am currently experimenting with swapping the order in the
> EngineUnit::goReverse, I will see what the results are.
It is possible of course. But I don't think it will be useful.
Swapping is just swapping - it doesn't matter where you do it -
inside ::goReverse() or inside MetaEngine, it's just the same number
of computer assembly instructions.
That will reduce the amount of swapping, because it will be
done only when interaction is created. I feel that the speed
improvement will be < 0.01% and that you are wasting your time with
that. Remember that it's swapping only pointers, so it's roughly
equivalent of std::swap(void*,void*).
If you will achieve any better speed improvement I will be really
surprised.
--
Janek Kozicki |
Follow ups
References