mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-04 05:42:46 +00:00
Set reasonable defaults for caching behavior
This commit is contained in:
@@ -46,7 +46,9 @@
|
|||||||
#include "../ifcgeom/IfcRepresentationShapeItem.h"
|
#include "../ifcgeom/IfcRepresentationShapeItem.h"
|
||||||
#include "../ifcgeom/IfcGeomShapeType.h"
|
#include "../ifcgeom/IfcGeomShapeType.h"
|
||||||
|
|
||||||
#define NO_CACHE
|
// Define this in case you want to conserve memory usage at all cost. This has been
|
||||||
|
// benchmarked extensively: https://github.com/IfcOpenShell/IfcOpenShell/pull/47
|
||||||
|
// #define NO_CACHE
|
||||||
|
|
||||||
#ifdef NO_CACHE
|
#ifdef NO_CACHE
|
||||||
|
|
||||||
|
|||||||
@@ -324,8 +324,12 @@ namespace IfcGeom {
|
|||||||
private:
|
private:
|
||||||
// Move to the next IfcRepresentation
|
// Move to the next IfcRepresentation
|
||||||
void _nextShape() {
|
void _nextShape() {
|
||||||
if (done % 100 == 99) {
|
// In order to conserve memory and reduce cache insertion times, the cache is
|
||||||
// kernel.purge_cache();
|
// cleared after an arbitary number of processed representations. This has been
|
||||||
|
// benchmarked extensively: https://github.com/IfcOpenShell/IfcOpenShell/pull/47
|
||||||
|
static const int clear_interval = 64;
|
||||||
|
if (done % clear_interval == clear_interval - 1) {
|
||||||
|
kernel.purge_cache();
|
||||||
}
|
}
|
||||||
ifcproducts.reset();
|
ifcproducts.reset();
|
||||||
++ representation_iterator;
|
++ representation_iterator;
|
||||||
|
|||||||
Reference in New Issue
Block a user