Skip to content

Commit 420aec8

Browse files
authored
Merge pull request #1839 from ThatOpen/tests
Tests
2 parents 9ec39c1 + 1790a11 commit 420aec8

9 files changed

Lines changed: 58 additions & 35 deletions

File tree

benchmark.md

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
11
# System informations
2-
{"cpuName":"Apple M1","freeRam":163.59375,"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 | 32 | 243 | 44249 | 83 | 103 | 0 |
7-
tests/ifcfiles/public/C20-Institute-Var-2.ifc | 10 | 80 | 612 | 147712 | 702 | 821 | 0 |
8-
tests/ifcfiles/public/FM_ARC_DigitalHub.ifc | 14 | 121 | 1140 | 266483 | 705 | 725 | 0 |
9-
tests/ifcfiles/public/ISSUE_005_haus.ifc | 2 | 21 | 212 | 44249 | 83 | 103 | 0 |
10-
tests/ifcfiles/public/ISSUE_021_Mini Project.ifc | 3 | 22 | 699 | 49044 | 2636 | 3697 | 0 |
11-
tests/ifcfiles/public/ISSUE_034_HouseZ.ifc | 5 | 34 | 155 | 81806 | 228 | 239 | 0 |
12-
tests/ifcfiles/public/ISSUE_044_test_IFCCOMPOSITEPROFILEDEF.ifc | 0 | 1 | 0 | 435 | 7 | 11 | 0 |
13-
tests/ifcfiles/public/ISSUE_053_20181220Holter_Tower_10.ifczip | 29 | 1740 | 5648 | 2807815 | 60285 | 60847 | 0 |
14-
tests/ifcfiles/public/ISSUE_068_ARK_NUS_skolebygg.ifc | 55 | 584 | 2239 | 945194 | 4459 | 4542 | 0 |
15-
tests/ifcfiles/public/ISSUE_102_M3D-CON-CD.ifc | 26 | 238 | 2340 | 503608 | 1616 | 1635 | 0 |
16-
tests/ifcfiles/public/ISSUE_102_M3D-CON.ifc | 6 | 47 | 219 | 123282 | 138 | 143 | 0 |
17-
tests/ifcfiles/public/ISSUE_126_model.ifc | 4 | 33 | 130 | 88876 | 257 | 288 | 0 |
18-
tests/ifcfiles/public/ISSUE_129_N1540_17_EXE_MOD_448200_02_09_11SMC_IGC_V17.ifc | 12 | 91 | 667 | 202661 | 959 | 981 | 0 |
19-
tests/ifcfiles/public/ISSUE_159_kleine_Wohnung_R22.ifc | 10 | 88 | 732 | 189788 | 425 | 457 | 0 |
20-
tests/ifcfiles/public/ISSUE_171_IfcSurfaceCurveSweptAreaSolid.ifc | 0 | 2 | 20 | 4327 | 60 | 141 | 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 |
2122
tests/ifcfiles/public/IfcOpenHouse_IFC4.ifc | 0 | 1 | 6 | 2885 | 35 | 43 | 0 |
22-
tests/ifcfiles/public/KIT-Simple-Road-Test-Web-IFC4x3_RC2.ifc | 0 | 3 | 4 | 6500 | 66 | 119 | 0 |
23-
tests/ifcfiles/public/Office_A_20110811.ifc | 4 | 27 | 280 | 62930 | 803 | 810 | 0 |
24-
tests/ifcfiles/public/S_Office_Integrated Design Archi.ifc | 30 | 304 | 6086 | 551442 | 3417 | 3873 | 0 |
25-
tests/ifcfiles/public/Sample_entities.ifc | 0 | 0 | 1 | 466 | 2 | 10 | 0 |
26-
tests/ifcfiles/public/Viadotto Acerno.ifc | 32 | 225 | 3732 | 253318 | 6546 | 7051 | 0 |
27-
tests/ifcfiles/public/advanced_model.ifc | 34 | 379 | 2387 | 594374 | 6401 | 14120 | 0 |
28-
tests/ifcfiles/public/dental_clinic.ifc | 12 | 200 | 431 | 209259 | 2586 | 2626 | 0 |
29-
tests/ifcfiles/public/duplex.ifc | 2 | 16 | 65 | 38898 | 215 | 224 | 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 |
3032
tests/ifcfiles/public/example.ifc | 0 | 3 | 8 | 6488 | 115 | 119 | 0 |
31-
tests/ifcfiles/public/ifcbridge-model01.ifc | 14 | 116 | 492 | 296968 | 165 | 168 | 0 |
32-
tests/ifcfiles/public/schependomlaan.ifc | 47 | 424 | 612 | 714485 | 3569 | 3643 | 0 |
33-
tests/ifcfiles/public/tested_sample_project.ifc | 1 | 5 | 98 | 14119 | 93 | 98 | 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 |
3436
#Totals
35-
*Total Time to Open*:4837
36-
*Total Time*:29258
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())

0 commit comments

Comments
 (0)