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

[refactor] Reduce compilation time by splitting and shortening headers #933

Closed
archibate opened this issue May 9, 2020 · 2 comments
Closed
Labels
c++ C++ engineering related enhancement Make existing things or codebases better feature request Suggest an idea on this project welcome contribution

Comments

@archibate
Copy link
Collaborator

archibate commented May 9, 2020

Concisely describe the proposed feature
Currently compliling taichi takes too long time can be a great resistance for contributors especially when your work involving common headers like ir.h or lang_util.h (I guess @xumingkuan suffers this most).

Describe the solution you'd like (if any)

  1. reduce length of these common headers by removing unused functions and classes.
  2. move some of the inline functions in .h to .c, and then .h only holds function declaration.
  3. split a large header like ir.h into multiple headers, since only part of the functions are used.
  4. some common utils may use macros instead of inline functions to reduce c++ lexer's pain.

Additional comments
It's slowing down recently. Not sure what added to these headers caused this.

TODO: add compile-time test/comparison result here.

Update: I also found that clang-8 is 5x slower than clang-7.

@archibate archibate added the feature request Suggest an idea on this project label May 9, 2020
@xumingkuan
Copy link
Contributor

xumingkuan commented May 9, 2020

Thanks for proposing this! I think we can try to remove this as the first task:

taichi/taichi/ir/ir.h

Lines 1555 to 1556 in d4a9c18

#include "taichi/ir/statements.h"
#include "taichi/ir/visitors.h"

It's virtually increasing the length of ir.h.

(Or maybe all files that include ir.h need statement.h?)

@archibate archibate changed the title [misc] shortening compile-time by make headers shorter and splited [refactor] shortening compile-time by make headers shorter and splited May 9, 2020
@archibate archibate added c++ C++ engineering related enhancement Make existing things or codebases better welcome contribution labels May 9, 2020
@yuanming-hu yuanming-hu changed the title [refactor] shortening compile-time by make headers shorter and splited [refactor] Reduce compilation time by splitting and shortening headers May 9, 2020
@k-ye
Copy link
Member

k-ye commented May 18, 2021

Covered in #2203

@k-ye k-ye closed this as completed May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ C++ engineering related enhancement Make existing things or codebases better feature request Suggest an idea on this project welcome contribution
Projects
None yet
Development

No branches or pull requests

3 participants