Macro Recompute Profiler

From FreeCAD Documentation
Revision as of 09:01, 3 April 2017 by DeepSOIC (talk | contribs) (Created page with "{{Macro|Icon=Text-x-python|Name=Macro Recompute Profiler|Description=Measures time it takes to recompute each feature in your project|Author=DeepSOIC|Version=0.1}} UNDER CONS...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

File:Text-x-python Macro Recompute Profiler

Description
Measures time it takes to recompute each feature in your project

Macro version: 0.1
Author: DeepSOIC
Author
DeepSOIC
Download
None
Links
Macro Version
0.1
Date last modified
None
FreeCAD Version(s)
None
Default shortcut
None
See also
None

UNDER CONSTRUCTION

How to use

Save the macro to a file.

1. Open your project 2. Right-click an object in model tree, pick "Mark to recompute" 3. Run this macro. A progress bar will appear. As each object is recomputed, a line is printed to Report View, containing the time and the label of the object.

Post-processing results

The output of the macro will be interleaved with general messages produced by recomputing features. It generally looks like this:

Recomputing... (time in seconds, label)
Sketcher::setUpSketch()-T:0
Sketcher::Solve()-DogLeg-T:0
	0.00999999046326	Sketch - master section
	0.0199999809265	Clone of Sketch - master section (2D)001
Sketcher::setUpSketch()-T:0
Sketcher::Solve()-DogLeg-T:0
	0.00999999046326	Sketch013
Sketcher::setUpSketch()-T:0
Sketcher::Solve()-DogLeg-T:0
	0.00999999046326	Sketch011
	0.0	Clone of Sketch - master section (2D)
Sketcher::setUpSketch()-T:0
Sketcher::Solve()-DogLeg-T:0
	0.0	Sketch008
	0.130000114441	LinearArray
Sketcher::setUpSketch()-T:0
Sketcher::Solve()-DogLeg-T:0
	0.0	Sketch010
Sketcher::setUpSketch()-T:0
Sketcher::Solve()-DogLeg-T:0
	0.0	Sketch001 - master xy
	0.00999999046326	Clone of Sketch001 - master xy (2D)
Sketcher::setUpSketch()-T:0
Sketcher::Solve()-DogLeg-T:0
	0.0	Sketch002
	0.0	Moved Sketch003
	0.00999999046326	Moved Sketch002
Sketcher::setUpSketch()-T:0
Sketcher::Solve()-DogLeg-T:0
	0.0	Sketch009
Sketcher::setUpSketch()-T:0
Sketcher::Solve()-DogLeg-T:0
	0.00999999046326	Sketch003
	0.0299999713898	Sweep
	0.00999999046326	Populate ArrayFilter002 with Sweep
	0.108999967575	Fusion
	0.0	Extrude
	0.591000080109	Slice
	0.160000085831	CompoundFilter
	0.0699999332428	Moved CompoundFilter
	0.00999999046326	Compound
Populate004: There are fewer children to populate, than placements to be populated (2, 49). Extra placements will be dropped.
	0.352999925613	Populate LinearArray with Compound
	0.0	Clone of Sketch - master section (2D)002
Sketcher::setUpSketch()-T:0
Sketcher::Solve()-DogLeg-T:0
	0.0	Sketch006
	0.0	Revolve
	0.00999999046326	Revolve001
	0.0	Module002 - tire
	0.0670001506805	Module - spokes
	0.138999938965	Cut
	0.0	Module001 - hub
	0.0	Part001 - hub
	0.0	Part - tire
	0.010999917984	ArrayFilter003
Hide main window
Show main window

The result lines have an easy way to separate them off: they start with a tab. So, if you copy-paste the whole chunk to a spreadsheet program, generic messages will end up in column 1, while the results are in columns 2 and 3. So, you can sort by column 2, to get a nice table like that:

0.59100008	Slice
0.352999926	Populate LinearArray with Compound
0.160000086	CompoundFilter
0.138999939	Cut
0.130000114	LinearArray
0.108999968	Fusion
0.069999933	Moved CompoundFilter
0.067000151	Module - spokes
0.029999971	Sweep
0.019999981	Clone of Sketch - master section (2D)001
0.010999918	ArrayFilter003