File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 1919
2020import os
2121import uuid
22+ import functools
2223import ifcopenshell
2324import ifcopenshell .guid as guid
2425import ifcjson .common as common
2526
2627class IFC2JSON4 :
28+ maxCache = 2048
2729 def __init__ (self , ifcFilePath ):
2830 self .ifcFilePath = ifcFilePath
2931 self .ifcModel = ifcopenshell .open (ifcFilePath )
@@ -46,6 +48,7 @@ def spf2Json(self):
4648 jsonObjects .append (self .id_objects [key ])
4749 return jsonObjects
4850
51+ @functools .lru_cache (maxsize = maxCache )
4952 def entityToDict (self , entity ):
5053 attr_dict = entity .__dict__
5154
@@ -147,6 +150,7 @@ def entityToDict(self, entity):
147150 d [attrKey ] = attr_dict [attr ]
148151 return d
149152
153+ @functools .lru_cache (maxsize = maxCache )
150154 def getEntityValue (self , value ):
151155 if value == None :
152156 jsonValue = None
You can’t perform that action at this time.
0 commit comments