Skip to content

Commit 1790a11

Browse files
committed
Update Opening
1 parent 151cc64 commit 1790a11

6 files changed

Lines changed: 59 additions & 38 deletions

File tree

benchmark.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
# System informations
2-
{"cpuName":"Apple M1","freeRam":140.171875,"totalRam":8192}
2+
{"cpuName":"Apple M1","freeRam":202.546875,"totalRam":8192}
33
_________
44
| filename | Size (mb) | Time to open model (ms) | Time to execute all (ms) | Total ifc entities | Total meshes | Total geometries | total errors |
55
|-------|-------|-------|-------|-------|-------|-------|-------|
6-
| tests/ifcfiles/public/AC20-FZK-Haus.ifc | 2 | 23 | 202 | 44249 | 83 | 103 | 0 |
7-
tests/ifcfiles/public/C20-Institute-Var-2.ifc | 10 | 76 | 545 | 147712 | 702 | 821 | 0 |
8-
tests/ifcfiles/public/FM_ARC_DigitalHub.ifc | 14 | 96 | 902 | 266483 | 705 | 725 | 0 |
9-
tests/ifcfiles/public/ISSUE_005_haus.ifc | 2 | 20 | 182 | 44249 | 83 | 103 | 0 |
10-
tests/ifcfiles/public/ISSUE_021_Mini Project.ifc | 3 | 21 | 631 | 49044 | 2636 | 3697 | 0 |
11-
tests/ifcfiles/public/ISSUE_034_HouseZ.ifc | 5 | 32 | 142 | 81806 | 228 | 239 | 0 |
12-
tests/ifcfiles/public/ISSUE_044_test_IFCCOMPOSITEPROFILEDEF.ifc | 0 | 0 | 1 | 435 | 7 | 11 | 0 |
13-
tests/ifcfiles/public/ISSUE_053_20181220Holter_Tower_10.ifczip | 29 | 1334 | 4495 | 2807815 | 60285 | 60847 | 0 |
14-
tests/ifcfiles/public/ISSUE_068_ARK_NUS_skolebygg.ifc | 55 | 446 | 1995 | 945194 | 4459 | 4542 | 0 |
15-
tests/ifcfiles/public/ISSUE_098_R8_F1_MAB_AR_M3_XX_XXX_MO_7000.ifc | 70 | 538 | 5410 | 1139622 | 11124 | 11338 | 0 |
16-
tests/ifcfiles/public/ISSUE_102_M3D-CON-CD.ifc | 26 | 210 | 2105 | 503608 | 1616 | 1635 | 0 |
17-
tests/ifcfiles/public/ISSUE_102_M3D-CON.ifc | 6 | 46 | 195 | 123282 | 138 | 143 | 0 |
18-
tests/ifcfiles/public/ISSUE_126_model.ifc | 4 | 30 | 108 | 88876 | 257 | 288 | 0 |
19-
tests/ifcfiles/public/ISSUE_129_N1540_17_EXE_MOD_448200_02_09_11SMC_IGC_V17.ifc | 12 | 82 | 594 | 202661 | 959 | 981 | 0 |
20-
tests/ifcfiles/public/ISSUE_159_kleine_Wohnung_R22.ifc | 10 | 72 | 651 | 189788 | 425 | 457 | 0 |
21-
tests/ifcfiles/public/ISSUE_171_IfcSurfaceCurveSweptAreaSolid.ifc | 0 | 1 | 18 | 4327 | 60 | 141 | 0 |
22-
tests/ifcfiles/public/IfcOpenHouse_IFC4.ifc | 0 | 1 | 5 | 2885 | 35 | 43 | 0 |
23-
tests/ifcfiles/public/KIT-Simple-Road-Test-Web-IFC4x3_RC2.ifc | 0 | 3 | 4 | 6500 | 66 | 119 | 0 |
24-
tests/ifcfiles/public/LTU_A-House_redesign.ifczip | 34 | 1523 | 6787 | 3359234 | 6928 | 6945 | 0 |
25-
tests/ifcfiles/public/Office_A_20110811.ifc | 4 | 26 | 169 | 62930 | 803 | 810 | 0 |
26-
tests/ifcfiles/public/S_Office_Integrated Design Archi.ifc | 30 | 252 | 5450 | 551442 | 3417 | 3873 | 0 |
27-
tests/ifcfiles/public/Sample_entities.ifc | 0 | 0 | 1 | 466 | 2 | 10 | 0 |
28-
tests/ifcfiles/public/Viadotto Acerno.ifc | 32 | 228 | 3243 | 253318 | 6546 | 7051 | 0 |
29-
tests/ifcfiles/public/advanced_model.ifc | 34 | 296 | 1648 | 594374 | 6401 | 14120 | 0 |
30-
tests/ifcfiles/public/dental_clinic.ifc | 12 | 90 | 403 | 209259 | 2586 | 2626 | 0 |
31-
tests/ifcfiles/public/duplex.ifc | 2 | 15 | 64 | 38898 | 215 | 224 | 0 |
32-
tests/ifcfiles/public/example.ifc | 0 | 4 | 8 | 6488 | 115 | 119 | 0 |
33-
tests/ifcfiles/public/ifcbridge-model01.ifc | 14 | 115 | 331 | 296968 | 165 | 168 | 0 |
34-
tests/ifcfiles/public/schependomlaan.ifc | 47 | 367 | 558 | 714485 | 3569 | 3643 | 0 |
35-
tests/ifcfiles/public/tested_sample_project.ifc | 1 | 4 | 80 | 14119 | 93 | 98 | 0 |
6+
| tests/ifcfiles/public/AC20-FZK-Haus.ifc | 2 | 28 | 195 | 44249 | 83 | 103 | 0 |
7+
tests/ifcfiles/public/C20-Institute-Var-2.ifc | 10 | 78 | 547 | 147712 | 702 | 821 | 0 |
8+
tests/ifcfiles/public/FM_ARC_DigitalHub.ifc | 14 | 92 | 859 | 266483 | 705 | 725 | 0 |
9+
tests/ifcfiles/public/ISSUE_005_haus.ifc | 2 | 17 | 177 | 44249 | 83 | 103 | 0 |
10+
tests/ifcfiles/public/ISSUE_021_Mini Project.ifc | 3 | 21 | 623 | 49044 | 2636 | 3697 | 0 |
11+
tests/ifcfiles/public/ISSUE_034_HouseZ.ifc | 5 | 33 | 140 | 81806 | 228 | 239 | 0 |
12+
tests/ifcfiles/public/ISSUE_044_test_IFCCOMPOSITEPROFILEDEF.ifc | 0 | 0 | 0 | 435 | 7 | 11 | 0 |
13+
tests/ifcfiles/public/ISSUE_053_20181220Holter_Tower_10.ifczip | 29 | 1301 | 4471 | 2807815 | 60285 | 60847 | 0 |
14+
tests/ifcfiles/public/ISSUE_068_ARK_NUS_skolebygg.ifc | 55 | 413 | 1931 | 945194 | 4459 | 4542 | 0 |
15+
tests/ifcfiles/public/ISSUE_098_R8_F1_MAB_AR_M3_XX_XXX_MO_7000.ifc | 70 | 492 | 5098 | 1139622 | 11124 | 11338 | 0 |
16+
tests/ifcfiles/public/ISSUE_102_M3D-CON-CD.ifc | 26 | 224 | 2119 | 503608 | 1616 | 1635 | 0 |
17+
tests/ifcfiles/public/ISSUE_102_M3D-CON.ifc | 6 | 45 | 178 | 123282 | 138 | 143 | 0 |
18+
tests/ifcfiles/public/ISSUE_126_model.ifc | 4 | 31 | 98 | 88876 | 257 | 288 | 0 |
19+
tests/ifcfiles/public/ISSUE_129_N1540_17_EXE_MOD_448200_02_09_11SMC_IGC_V17.ifc | 12 | 82 | 580 | 202661 | 959 | 981 | 0 |
20+
tests/ifcfiles/public/ISSUE_159_kleine_Wohnung_R22.ifc | 10 | 71 | 575 | 189788 | 425 | 457 | 0 |
21+
tests/ifcfiles/public/ISSUE_171_IfcSurfaceCurveSweptAreaSolid.ifc | 0 | 2 | 18 | 4327 | 60 | 141 | 0 |
22+
tests/ifcfiles/public/IfcOpenHouse_IFC4.ifc | 0 | 1 | 6 | 2885 | 35 | 43 | 0 |
23+
tests/ifcfiles/public/KIT-Simple-Road-Test-Web-IFC4x3_RC2.ifc | 0 | 2 | 4 | 6500 | 66 | 119 | 0 |
24+
tests/ifcfiles/public/LTU_A-House_redesign.ifczip | 34 | 1312 | 6512 | 3359234 | 6928 | 6945 | 0 |
25+
tests/ifcfiles/public/Office_A_20110811.ifc | 4 | 27 | 180 | 62930 | 803 | 810 | 0 |
26+
tests/ifcfiles/public/S_Office_Integrated Design Archi.ifc | 30 | 244 | 5399 | 551442 | 3417 | 3873 | 0 |
27+
tests/ifcfiles/public/Sample_entities.ifc | 0 | 0 | 0 | 466 | 2 | 10 | 0 |
28+
tests/ifcfiles/public/Viadotto Acerno.ifc | 32 | 225 | 3216 | 253318 | 6546 | 7051 | 0 |
29+
tests/ifcfiles/public/advanced_model.ifc | 34 | 275 | 1563 | 594374 | 6401 | 14120 | 0 |
30+
tests/ifcfiles/public/dental_clinic.ifc | 12 | 83 | 398 | 209259 | 2586 | 2626 | 0 |
31+
tests/ifcfiles/public/duplex.ifc | 2 | 15 | 60 | 38898 | 215 | 224 | 0 |
32+
tests/ifcfiles/public/example.ifc | 0 | 3 | 8 | 6488 | 115 | 119 | 0 |
33+
tests/ifcfiles/public/ifcbridge-model01.ifc | 14 | 109 | 302 | 296968 | 165 | 168 | 0 |
34+
tests/ifcfiles/public/schependomlaan.ifc | 47 | 337 | 501 | 714485 | 3569 | 3643 | 0 |
35+
tests/ifcfiles/public/tested_sample_project.ifc | 1 | 5 | 75 | 14119 | 93 | 98 | 0 |
3636
#Totals
37-
*Total Time to Open*:5951
38-
*Total Time*:36927
37+
*Total Time to Open*:5568
38+
*Total Time*:35833

src/cpp/web-ifc/parsing/IfcFileStream.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@
88

99
IfcTokenStream::IfcFileStream::IfcFileStream(const std::function<uint32_t(char *, size_t, size_t)> &requestData, uint32_t size) : _dataSource(requestData), _size(size)
1010
{
11-
_buffer = nullptr;
12-
load();
11+
12+
char * countBuffer = new char[_size];
13+
size_t countSize = 0;
14+
size_t startCountRef =0;
15+
while ((countSize = _dataSource(countBuffer, startCountRef, _size)) != 0) {
16+
for (size_t i=0; i < countSize;i++) if (countBuffer[i]=='\n') noLines++;
17+
startCountRef+=countSize;
18+
}
19+
delete[] countBuffer;
20+
_buffer = nullptr;
21+
load();
1322
}
1423

1524
IfcTokenStream::IfcFileStream::~IfcFileStream()
@@ -19,6 +28,10 @@
1928
_buffer = nullptr;
2029
}
2130
}
31+
32+
size_t IfcTokenStream::IfcFileStream::GetNoLines() {
33+
return noLines;
34+
}
2235

2336
void IfcTokenStream::IfcFileStream::load()
2437
{

src/cpp/web-ifc/parsing/IfcLoader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ namespace webifc::parsing {
227227

228228
void IfcLoader::ParseLines()
229229
{
230-
uint32_t currentIfcType = 0;
230+
_lines.reserve(_tokenStream->GetNoLines());
231+
uint32_t currentIfcType = 0;
231232
uint32_t currentExpressID = 0;
232233
uint32_t currentTapeOffset = 0;
233234
while (!_tokenStream->IsAtEnd())

src/cpp/web-ifc/parsing/IfcLoader.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ namespace webifc::parsing
6565
void PushInt(int input);
6666
std::string GenerateUUID() const;
6767
IfcLoader* Clone();
68-
6968
uint32_t GetNextExpressID(uint32_t expressId) const;
7069
template <typename T> void Push(T input)
7170
{

src/cpp/web-ifc/parsing/IfcTokenStream.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ namespace webifc::parsing
2424
delete _fileStream;
2525
}
2626

27+
size_t IfcTokenStream::GetNoLines() {
28+
if (_fileStream != nullptr) return _fileStream->GetNoLines();
29+
return 0;
30+
}
31+
2732
void IfcTokenStream::SetTokenSource(const std::function<uint32_t(char *, size_t, size_t)> &requestData)
2833
{
2934
_fileStream = new IfcFileStream(requestData,_chunkSize);

src/cpp/web-ifc/parsing/IfcTokenStream.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ namespace webifc::parsing
6161
size_t GetReadOffset();
6262
size_t GetTotalSize();
6363
IfcTokenStream * Clone();
64+
size_t GetNoLines();
6465

6566
private:
6667
void checkMemory();
@@ -83,6 +84,7 @@ namespace webifc::parsing
8384
bool IsAtEnd();
8485
char Get();
8586
void Clear();
87+
size_t GetNoLines();
8688
IfcFileStream * Clone();
8789
private:
8890
void load();
@@ -92,7 +94,8 @@ namespace webifc::parsing
9294
char prev;
9395
size_t _currentSize=0;
9496
size_t _startRef=0;
95-
char * _buffer;
97+
char * _buffer;
98+
size_t noLines=0;
9699
};
97100
class IfcTokenChunk
98101
{

0 commit comments

Comments
 (0)