Skip to content

Gate micro-timers behind verbose flag - #561

Open
calewis wants to merge 1 commit into
berkeley-abc:masterfrom
calewis:opt_timers
Open

Gate micro-timers behind verbose flag#561
calewis wants to merge 1 commit into
berkeley-abc:masterfrom
calewis:opt_timers

Conversation

@calewis

@calewis calewis commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Avoids clock calls in hot loops when not in verbose mode. Compile with -DABC_NO_TIMERS to turn off inner-loop timers entirely.

On i10.aig (b; rs -K 6 -N 2; rf; rw; rs -K 8 -N 2; rf -z; rw -z): verbose 0.103s, default 0.100s (-3.3%), -DABC_NO_TIMERS 0.099s (-3.8%).

Avoids clock calls in hot loops when not in verbose mode.
Compile with -DABC_NO_TIMERS to turn off inner-loop timers entirely.

On i10.aig (b; rs -K 6 -N 2; rf; rw; rs -K 8 -N 2; rf -z; rw -z):
verbose 0.103s, default 0.100s (-3.3%), -DABC_NO_TIMERS 0.099s (-3.8%).
@wjrforcyber

Copy link
Copy Markdown
Contributor

Maybe a single choke point inside Abc_Clock() itself would avoid lots of repeated changes in the future? Since currently the changes only affect those mentioned optimisers. 🤔

@calewis

calewis commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Abc_Clock is also used in places that have timeouts so we can't just have a define that makes Abc_Clock return 0. Also having a way to avoid calling Abc_Clock when verbose mode is disabled saves a decent amount of time. Clock calls aren't free and the verbosity check helps a good bit to fix that.

@wjrforcyber

Copy link
Copy Markdown
Contributor

Abc_Clock is also used in places that have timeouts so we can't just have a define that makes Abc_Clock return 0.

Yes, they are used in comparison and branches. Maybe it's just I see only a few of "comparison/branches" but a great amount of "measurement", so even manually do it I'll prefer modifying the former instead of the latter.

Also having a way to avoid calling Abc_Clock when verbose mode is disabled saves a decent amount of time. Clock calls aren't free and the verbosity check helps a good bit to fix that.

Fair point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants