NREL / gbxml-to-openstudio

Releases of the OpenStudio CLI for Revit Systems Analysis.
5 stars 2 forks source link

profiling #96

Closed MatthewSteen closed 3 months ago

MatthewSteen commented 3 years ago

Initial findings of workflow profiling using Ruby's Benchmark Module. FYI @axelstudios.

Summary

The advanced_import_gbxml measure accounts for most of the workflow CPU time.

Fixes

Workflow Profiling

image

Total CPU Time by Measure 200_Spaces 400_Spaces 800_Spaces
import_gbxml 11.3 53.4 255
advanced_import_gbxml 93.5 385.9 1403.1
gbxml_hvac_import 5.7 28 46.2
gbxml_to_openstudio_cleanup 0 0 0
add_xml_output_control_style 0 0 0
openstudio_results 85.1 175.8 347
systems_analysis_report_generator 1.6 3.2 6.6
Total Time 197.2 646.4 2058

Measure Profiling

Within the advanced_import_gbxml measure, the OsLib_AdvImport.add_objects_from_adv_import_hash call below accounts for the majority of the time for this section of the measure.

image

https://github.com/NREL/gbxml-to-openstudio/blob/18e1cb5f8f8959f9726b4d28224feab1b64df4d5/measures/advanced_import_gbxml/measure.rb#L376-L380

Module Profiling

Within the OsLib_AdvImport module, the assign_zone_attributes function accounts for the majority of the time.

https://github.com/NREL/gbxml-to-openstudio/blob/18e1cb5f8f8959f9726b4d28224feab1b64df4d5/measures/advanced_import_gbxml/resources/os_lib_adv_import.rb#L241-L265

Benchmark results for functions in the OsLib_AdvImport module.

Function Time (s) 200_Spaces
OsLib_Schedules.addScheduleTypeLimits 0
OsLib_AdvImport.import_schs 0
OsLib_AdvImport.schedule_sets 0
OsLib_AdvImport.import_lights 0
OsLib_AdvImport.import_elec_equipment 0
OsLib_AdvImport.import_people 0
OsLib_AdvImport.assign_space_attributes 0.8
OsLib_AdvImport.assign_zone_attributes 88.8
MatthewSteen commented 3 years ago

Results

Summary

Results of the changes to the _advanced_importgbxml measure on workflow time.

Assumptions

  1. Benchmark and improved times are the same for all measures except the _advanced_importgbxml measure.
    • This is due to slight differences in times between different workflow runs.
  2. Time savings are for pre-simulation times that exclude OpenStudio Reporting Measures (_openstudioresults and _systems_analysis_reportgenerator measures), which are run after the simulation is completed, for two reasons.
    • Some models failed during the EnergyPlus simulation.
    • Some models took hours to complete the EnergyPlus simulation.

Autodesk

Results from Autodesk's gbXML files showed pre-simulation workflow time savings up to 76%.

Benchmark Time (s) import_gbxml _advanced_importgbxml gbxml_hvac_import gbxml_to_openstudio_cleanup add_xml_output_control_style Total (s)
200_Spaces 11.3 93.5 5.7 0 0 110.5
400_Spaces 53.4 385.9 28 0 0 467.4
800_Spaces 255 1403.1 46.2 0 0 1704.4
2794Space24kSurfaces 6869.6 26788 224.6 0.1 0 33882.3
Church-space-based-EAM 24798.4 3423.8 369.6 0.1 0 28591.9
Church-voxel-based-gbxml 17966.7 4385.7 210.9 0 0 22563.3
Improved Time (s) import_gbxml _advanced_importgbxml gbxml_hvac_import gbxml_to_openstudio_cleanup add_xml_output_control_style Total (s)
200_Spaces 11.3 13.6 5.7 0 0 30.6
400_Spaces 53.4 34 28 0 0 115.5
800_Spaces 255 111.5 46.2 0 0 412.8
2794Space24kSurfaces 6869.6 1459.9 224.6 0.1 0 8554.2
Church-space-based-EAM 24798.4 870.6 369.6 0.1 0 26038.7
Church-voxel-based-gbxml 17966.7 642.7 210.9 0 0 18820.3
Savings (%) import_gbxml _advanced_importgbxml gbxml_hvac_import gbxml_to_openstudio_cleanup add_xml_output_control_style Total (%)
200_Spaces 0 85.5 0 0 0 72.3
400_Spaces 0 91.2 0 0 0 75.3
800_Spaces 0 92.1 0 0 0 75.8
2794Space24kSurfaces 0 94.6 0 0 0 74.8
Church-space-based-EAM 0 74.6 0 0 0 8.9
Church-voxel-based-gbxml 0 85.3 0 0 0 16.6

GreenBuildingXML

Results from Sample_gbXML_Files showing pre-simulation workflow time savings up to 49%.

Benchmark Time (s) import_gbxml _advanced_importgbxml gbxml_hvac_import gbxml_to_openstudio_cleanup add_xml_output_control_style Total (s)
ARCH_ASHRAE_Headquarters_r16_detached 3.5 11 8.7 0 0 23.2
ChapelHillOffice 22.3 16.6 10.5 0 0 49.4
ConferenceCenter_(Older) 9.4 5.1 3.4 0 0 17.9
ExerciseFacility_(Older) 0.1 0.4 0 0 0 0.4
gbXML_TRK 0.2 1.3 0.5 0 0 2
gbXMLExport_ASHRAEHQ_Revit2017 32 34.6 10.7 0 0 77.3
gbXMLStandard 30.3 104.3 14.7 0 0 149.3
gbXMLStandardOffice(ASHRAE_HQ)_2016 17.6 15.6 10 0 0 43.1
gbXMLStandardOffice(Core_&_Shell)_2016 6.5 6.4 4.9 0 0 17.8
gbXMLStandard_Single_Family_Residential_2016 0.3 2.3 1.1 0 0 3.7
gbXMLStandard_Test_Model_2016 0.1 0.5 0.4 0 0 1
gbXMLStandardv_Retail_Big_Box 0.6 3.4 2.4 0 0 6.4
OfficeBuilding_(Older) 0.6 1.1 0.7 0 0 2.5
Skyline_B12-Mech_2016-12-21 1.2 4.2 2.9 0 0 8.4
Urban_House_MEP 0.4 1.7 1.3 0 0 3.3
Improved Time (s) import_gbxml _advanced_importgbxml gbxml_hvac_import gbxml_to_openstudio_cleanup add_xml_output_control_style Total (s)
ARCH_ASHRAE_Headquarters_r16_detached 3.5 10.2 8.7 0 0 22.4
ChapelHillOffice 22.3 13.2 10.5 0 0 46.1
ConferenceCenter_(Older) 9.4 4.6 3.4 0 0 17.4
ExerciseFacility_(Older) 0.1 0.3 0 0 0 0.4
gbXML_TRK 0.2 1.1 0.5 0 0 1.8
gbXMLExport_ASHRAEHQ_Revit2017 32 19.6 10.7 0 0 62.3
gbXMLStandard 30.3 30.6 14.7 0 0 75.6
gbXMLStandardOffice(ASHRAE_HQ)_2016 17.6 15.8 10 0 0 43.4
gbXMLStandardOffice(Core_&_Shell)_2016 6.5 6.9 4.9 0 0 18.2
gbXMLStandard_Single_Family_Residential_2016 0.3 2 1.1 0 0 3.5
gbXMLStandard_Test_Model_2016 0.1 0.6 0.4 0 0 1
gbXMLStandardv_Retail_Big_Box 0.6 3.3 2.4 0 0 6.3
OfficeBuilding_(Older) 0.6 1 0.7 0 0 2.3
Skyline_B12-Mech_2016-12-21 1.2 3.8 2.9 0 0 8
Urban_House_MEP 0.4 1.7 1.3 0 0 3.3
Savings (%) import_gbxml _advanced_importgbxml gbxml_hvac_import gbxml_to_openstudio_cleanup add_xml_output_control_style Total (%)
ARCH_ASHRAE_Headquarters_r16_detached 0 7.2 0 0 0 3.4
ChapelHillOffice 0 20.2 0 0 0 6.8
ConferenceCenter_(Older) 0 9.5 0 0 0 2.7
ExerciseFacility_(Older) 0 11.3 0 0 0 9.8
gbXML_TRK 0 10.9 0 0 0 7
gbXMLExport_ASHRAEHQ_Revit2017 0 43.4 0 0 0 19.4
gbXMLStandard 0 70.6 0 0 0 49.3
gbXMLStandardOffice(ASHRAE_HQ)_2016 0 -1.5 0 0 0 -0.5
gbXMLStandardOffice(Core_&_Shell)_2016 0 -6.7 0 0 0 -2.4
gbXMLStandard_Single_Family_Residential_2016 0 12 0 0 0 7.3
gbXMLStandard_Test_Model_2016 0 -4.5 0 0 0 -2.5
gbXMLStandardv_Retail_Big_Box 0 3.7 0 0 0 2
OfficeBuilding_(Older) 0 16 0 0 0 7.5
Skyline_B12-Mech_2016-12-21 0 10 0 0 0 5.1
Urban_House_MEP 0 1.4 0 0 0 0.7
MatthewSteen commented 2 years ago

Results from Autodesk

...the performance improvements seem to work well with larger models seeing a 20%-45% performance gain. The results on the regression farm remained unchanged too.