cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.08k stars 4.3k forks source link

[Phase2 RelVal] ~12 million allocations from `MTDGeometricTimingDetESModule::produce()` #46512

Open makortel opened 1 hour ago

makortel commented 1 hour ago

From https://github.com/cms-sw/cmssw/issues/45854#issuecomment-2436137581

The MTDGeometricTimingDetESModule::produce() makes ~12 million memory allocations, of which nearly all come from string construction in DDNameFilter::accept() (IgProf profile) https://github.com/cms-sw/cmssw/blob/f71ff4c3c27738ed0f20b3852adb60083a1e81a1/Geometry/MTDNumberingBuilder/plugins/DDCmsMTDConstruction.cc#L28-L29

The ev.logicalPart().name().fullname() returns a newly constructed string https://github.com/cms-sw/cmssw/blob/f71ff4c3c27738ed0f20b3852adb60083a1e81a1/DetectorDescription/Core/interface/DDName.h#L40-L43

Especially how the DDNameFilter is used https://github.com/cms-sw/cmssw/blob/f71ff4c3c27738ed0f20b3852adb60083a1e81a1/Geometry/MTDNumberingBuilder/plugins/DDCmsMTDConstruction.cc#L48-L51 I'd suggest to compare the namespace and name parts of DDName separately to avoid the string construction.

makortel commented 1 hour ago

assign Geometry/MTDNumberingBuilder

cmsbuild commented 1 hour ago

New categories assigned: geometry,upgrade

@bsunanda,@civanch,@Dr15Jones,@kpedro88,@makortel,@mdhildreth,@Moanwar,@srimanob,@subirsarkar you have been requested to review this Pull request/Issue and eventually sign? Thanks

cmsbuild commented 1 hour ago

cms-bot internal usage

cmsbuild commented 1 hour ago

A new Issue was created by @makortel.

@Dr15Jones, @antoniovilela, @makortel, @mandrenguyen, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

makortel commented 1 hour ago

@cms-sw/mtd-dpg-l2