Skip to content

Commit

Permalink
Refactor Driver::runInternal (#10906)
Browse files Browse the repository at this point in the history
Summary:
This PR is part of #10888

The `Driver::runInternal()` function has become too long and too hard to read. This PR refactors it with two changes:

1. Refactor the operator timing code:
    Previously, a DeltaCpuWallTimer needs to be created at the beginning of
    each operator call block. This part of code is usually greater than 4
    lines, making the Driver::runInternal() function too long and hard to
    read. This commit extracts the common code into withDeltaCpuWallTimer()
    function, such that measuring the operator time is easy and clean.

2. Extract common functions so that readers can focus more on the real driver logic.

Pull Request resolved: #10906

Reviewed By: xiaoxmeng

Differential Revision: D62995248

Pulled By: Yuhta

fbshipit-source-id: 88ea016b8c68adf5349fc6695341c79b5457f4cf
  • Loading branch information
yingsu00 authored and facebook-github-bot committed Sep 19, 2024
1 parent 5127cfe commit 243f9e5
Show file tree
Hide file tree
Showing 3 changed files with 212 additions and 208 deletions.
Loading

0 comments on commit 243f9e5

Please sign in to comment.