step-examples/12-10-perf/Pf031.stp
Sources
- OCCT MANTIS#0033350
- OCCT MANTIS#0027570
- OCCT MANTIS#0023979 (OCCT MANTIS tracker 502 as of 2026-05-02)
Description
A STEP reader's parser reads each character in single-byte fashion through a buffered stream, calling the buffer's underlying read function per character. For a 100 MB file, this issues hundreds of millions of OS read calls, dominating runtime.
Reproducer recipe
Large (100 MB) STEP file with millions of small entities. Read; observe parser CPU dominated by I/O syscalls.
Expected kernel behavior
Heal and accept: parser uses bulk-buffered I/O; tokenisation operates on memory-mapped or fully-buffered input. Must not hang on cold-cache reads.
Notes
**See also**: Pf032.
Expected validation
occt=shape(1)/shape(1) gmsh=shape(1) ifc=schema_n/a
Byte assertions
count_entity_def(b'CARTESIAN_POINT') >= 29
Tier-3 assertions
load == "ok"
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Pf031: STEP read parsing slow due to single-pass tokenisation: parser issues one read syscall per character; 100 MB file with millions of small entities causes hundreds of millions of OS read calls; heal: use bulk-buffered I/O or memory-mapped input; scaled-down representative with 30 CARTESIAN_POINTs â replicate to 10^6 for production scale; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Pf031'),'2;1'); 5FILE_NAME('Pf031.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 7ENDSEC; 8DATA; 9#9000=APPLICATION_CONTEXT('mechanical design'); 10#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 11#2=CARTESIAN_POINT('',(1.0,0.0,0.0)); 12#3=CARTESIAN_POINT('',(2.0,0.0,0.0)); 13#4=CARTESIAN_POINT('',(3.0,0.0,0.0)); 14#5=CARTESIAN_POINT('',(4.0,0.0,0.0)); 15#6=CARTESIAN_POINT('',(5.0,0.0,0.0)); 16#7=CARTESIAN_POINT('',(6.0,0.0,0.0)); 17#8=CARTESIAN_POINT('',(7.0,0.0,0.0)); 18#9=CARTESIAN_POINT('',(8.0,0.0,0.0)); 19#10=CARTESIAN_POINT('',(9.0,0.0,0.0)); 20#11=CARTESIAN_POINT('',(0.0,1.0,0.0)); 21#12=CARTESIAN_POINT('',(1.0,1.0,0.0)); 22#13=CARTESIAN_POINT('',(2.0,1.0,0.0)); 23#14=CARTESIAN_POINT('',(3.0,1.0,0.0)); 24#15=CARTESIAN_POINT('',(4.0,1.0,0.0)); 25#16=CARTESIAN_POINT('',(5.0,1.0,0.0)); 26#17=CARTESIAN_POINT('',(6.0,1.0,0.0)); 27#18=CARTESIAN_POINT('',(7.0,1.0,0.0)); 28#19=CARTESIAN_POINT('',(8.0,1.0,0.0)); 29#20=CARTESIAN_POINT('',(9.0,1.0,0.0)); 30#21=CARTESIAN_POINT('',(0.0,2.0,0.0)); 31#22=CARTESIAN_POINT('',(1.0,2.0,0.0)); 32#23=CARTESIAN_POINT('',(2.0,2.0,0.0)); 33#24=CARTESIAN_POINT('',(3.0,2.0,0.0)); 34#25=CARTESIAN_POINT('',(4.0,2.0,0.0)); 35#26=CARTESIAN_POINT('',(5.0,2.0,0.0)); 36#27=CARTESIAN_POINT('',(6.0,2.0,0.0)); 37#28=CARTESIAN_POINT('',(7.0,2.0,0.0)); 38#29=CARTESIAN_POINT('',(8.0,2.0,0.0)); 39#30=CARTESIAN_POINT('',(9.0,2.0,0.0)); 40#31=GEOMETRIC_CURVE_SET('',(#1)); 41#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 42#9051=PRODUCT('Pf031','Pf031','',(#9050)); 43#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 44#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 45#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 46#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 47#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 48#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 49#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 50#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value',''); 51#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 52#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#31),#9060); 53#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 54ENDSEC; 55END-ISO-10303-21;