code-google-com / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Load-hit-stores in btUnionFind::find #321

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Examine btUnionFind::find function, code for USE_PATH_COMPRESSION
2. Notice these two lines:
    m_elements[x].m_id = m_elements[m_elements[x].m_id].m_id;
    x = m_elements[x].m_id;
3. Load-hit-store in the second line.

What is the expected output? What do you see instead?
Possible workaround:
#ifdef USE_PATH_COMPRESSION
    const btElement* elementPtr = &m_elements[m_elements[x].m_id];
    m_elements[x].m_id = elementPtr->m_id;
    x = elementPtr->m_id;
#else
    x = m_elements[x].m_id;
#endif //

What version of the product are you using? On what operating system?
Bullet 2.75, Xbox 360

Please provide any additional information below.

Original issue reported on code.google.com by holorose on 18 Dec 2009 at 1:55

GoogleCodeExporter commented 9 years ago

Thanks, I'll look into fixing that.

Do you have other performance recommendations? How did you find this LHS issue?

Futhermore, I tracked down your project and enjoyed reading your blog. For 
Bullet, 
I'm going to add a nice serialization system that stores its structures as 
well, with 
automatic pointer fixup, 32/64 bit/little/big endian and forward/backward 
compatibility. It is based on parsing C structures from the Bullet header 
files, I 
leave the complexity of C++ parsing for another project.

One nice feature of the upcoming .bullet fileformat is that you can 
autogenerate 
headerfiles to load and use the structures in-place, without any Bullet 
dependency.

Cheers,
Erwin

Original comment by erwin.coumans on 18 Dec 2009 at 4:50

GoogleCodeExporter commented 9 years ago
Patch was applied, see http://code.google.com/p/bullet/source/detail?r=1851

Original comment by erwin.coumans on 18 Dec 2009 at 10:05

GoogleCodeExporter commented 9 years ago

Original comment by erwin.coumans on 21 Dec 2009 at 7:18