Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ir] [refactor] Slim ir.h and reduce the build time by ~4% #761

Merged
merged 9 commits into from
Apr 13, 2020

Conversation

xumingkuan
Copy link
Contributor

@xumingkuan xumingkuan commented Apr 12, 2020

Related issue = #689

Hopefully, this will also reduce the build time.

Benchmark (after commit fe533e5, on my laptop with Windows 10 and i7-7700hq CPU, rebuild 3 times before and after this PR):
before: build time: 2m59s, 2m51s, 2m49s.
after: build time: 2m44s, 2m44s, 2m43s.
before (reproduce)(rebuild after writing this PR and checking out to the previous version): build time: 2m50s, 2m51s, 2m53s.

After merging with master (after commit 936cd97):
before: 2m52s, 2m53s.
after: 2m47s, 2m47s.

After merging with master again (after commit fbc12ab):
before: 2m55s.
after: 2m46s.

[Click here for the format server]

@yuanming-hu yuanming-hu self-requested a review April 12, 2020 22:07
@xumingkuan
Copy link
Contributor Author

Looks like I can't move template classes' functions to ir.cpp. (for example, member functions of LaneAttribute<T>)

@xumingkuan
Copy link
Contributor Author

And any other template functions, like template <typename T> inline void StmtFieldManager::operator()(const char *key, T &&value).

@yuanming-hu
Copy link
Member

Right, template functions cannot be moved to cpp unless you do explicit template instantiation. I would suggest simply leaving these in the header file.

@xumingkuan xumingkuan marked this pull request as ready for review April 13, 2020 02:48
@xumingkuan xumingkuan changed the title [ir] [refactor] Slim ir.h [ir] [refactor] Slim ir.h and reduce the build time by 4% Apr 13, 2020
@xumingkuan xumingkuan changed the title [ir] [refactor] Slim ir.h and reduce the build time by 4% [ir] [refactor] Slim ir.h and reduce the build time by ~4% Apr 13, 2020
Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks! The IR part is more organized now. Please fix Travis, and I'll merge this in.

4% compilation time improvement is awesome! I appreciate that you have done a solid benchmark. Note that not every file includes ir.h so the actual compilation time improvements for code related to the compiler is, I guess, probably ~10%.

I believe you'll get more performance boost after splitting Expression (frontend) from chi (middle-end). We can do that as well sometime in the future.

@yuanming-hu yuanming-hu merged commit 072e286 into taichi-dev:master Apr 13, 2020
@xumingkuan xumingkuan deleted the slim-ir-h branch April 16, 2020 23:13
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.

3 participants