aleuly / ifcplusplus

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

Performance issue #37

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. During Loading some IFC files.

What is the expected output? What do you see instead?
Slow performance during loading IFC files and destroying 
std::map<int, shared_ptr<IfcPPEntity>

What version of the product are you using? On what operating system?

I use old version of ifcplusplus, that doesn't support C++ 11, because the 
project using Visual C++ 2008 compiler.
Project was tested on Windows 7 x64

Please provide any additional information below.

Hi, thank you for this library!

I tried to research the performance issue of ifcpluplus library. I'm using AMD 
Code XL 1.9.

1. I replaced std::map<int, shared_ptr<IfcPPEntity> to 
boost::container::flat_map<int, shared_ptr<IfcPPEntity> >. Also, may replace to 
boost::unordered_map<int, shared_ptr<IfcPPEntity> >.

std::map and boost::container::flat_map have the identical O(1) complexity, but 
std::map have the very big cache miss and memory allocations.

2. Also for boost::shared_ptr may to add some macros.

src\ifcpp\model\shared_ptr.h:

#ifndef BOOST_SP_DISABLE_THREADS
#define BOOST_SP_DISABLE_THREADS
#endif
#ifndef BOOST_SP_USE_QUICK_ALLOCATOR
#define BOOST_SP_USE_QUICK_ALLOCATOR
#endif
#ifndef BOOST_SP_NO_ATOMIC_ACCESS
#define BOOST_SP_NO_ATOMIC_ACCESS
#endi

BOOST_SP_USE_QUICK_ALLOCATOR - using for fast allocations.
BOOST_SP_DISABLE_THREADS/BOOST_SP_NO_ATOMIC_ACCESS - if using single thread for 
loading

I attached the edited version of ifcplusplus library. You can use it for the 
future versions. Thanks!

Original issue reported on code.google.com by geecandrey on 11 Feb 2015 at 2:46

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by fabian.g...@gmail.com on 11 Feb 2015 at 10:18