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

Clean up redundant code for TiFlash #2019

Open
12 of 18 tasks
JaySon-Huang opened this issue May 28, 2021 · 8 comments
Open
12 of 18 tasks

Clean up redundant code for TiFlash #2019

JaySon-Huang opened this issue May 28, 2021 · 8 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/code-quality-improvement PR that can improve the code quality

Comments

@JaySon-Huang
Copy link
Contributor

JaySon-Huang commented May 28, 2021

TiFlash fork from Clickhouse around late 2018. There are lots of useless codes for TiFlash.

Something not sure:

  • Remove redundant data types so that we don't need to instantiate some template class for these data types, which may greatly reduce our compile time
    • "DataTypeDate"/"DateTypeDateTime"
      We use "DataTypeMyDate"/"DataTypeMyDatetime" for MySQL/TiDB-compatibility, these original data types ported from Clickhouse are useless for TiFlash
    • "DataTypeTuple"/"DataTypeArray"/"DataTypeSet"
      We don't use these data type

Possible it is good for speeding up our CI building step #1390.

@JaySon-Huang JaySon-Huang added the type/testing Issue or PR for testing label May 28, 2021
@JaySon-Huang
Copy link
Contributor Author

/cc @birdstorm @solotzg

@SchrodingerZhu
Copy link
Contributor

I think during the cleanup, one can also try to eliminate warnings.
Personally, I think it is a good idea to keep -Wall -Wextra -Werror; warnings are helpful for find silly bugs and typos at the first place.
For some special situations, like memcpy on non-trivial structs, if we are confident about the safety, we can wrap up them with pragmas to make the compiler happy.
Huge work is needed but I think it is worthy of the efforts to have a clean code base.

@JaySon-Huang
Copy link
Contributor Author

I think during the cleanup, one can also try to eliminate warnings.
Personally, I think it is a good idea to keep -Wall -Wextra -Werror; warnings are helpful for find silly bugs and typos at the first place.
For some special situations, like memcpy on non-trivial structs, if we are confident about the safety, we can wrap up them with pragmas to make the compiler happy.
Huge work is needed but I think it is worthy of the efforts to have a clean code base.

A related issue under Apple clang 12.0.5 #1887

@solotzg
Copy link
Contributor

solotzg commented May 29, 2021

#2020 this pr could optimize time cost of tics_ghpr_build from 45mins to 14mins if nearly 80% cache hit. @JaySon-Huang

@JaySon-Huang
Copy link
Contributor Author

#2020 this pr could optimize time cost of tics_ghpr_build from 45mins to 14mins if nearly 80% cache hit. @JaySon-Huang

Great to see that our building CI down to 14 mins!

I open this issue mainly for cleaning up redundant codes so that we can have a more clean codebase. This may be good for those new to the TiFlash project and help us if TiFlash gets opened to the public someday.
Speeding up our building CI may be a side effect of it.

This was referenced Jun 25, 2021
@JaySon-Huang JaySon-Huang added type/code-quality-improvement PR that can improve the code quality and removed type/testing Issue or PR for testing labels Aug 19, 2021
@JaySon-Huang JaySon-Huang added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Nov 10, 2021
@ywqzzy
Copy link
Contributor

ywqzzy commented May 11, 2022

Is storageFile related code useless?

@JaySon-Huang
Copy link
Contributor Author

@ywqzzy StorageFile is used by TableFunctionFile, I think both of them are useless for TiFlash.

@ywqzzy
Copy link
Contributor

ywqzzy commented May 12, 2022

@ywqzzy StorageFile is used by TableFunctionFile, I think both of them are useless for TiFlash.

I will remove all of them.

@ywqzzy ywqzzy mentioned this issue Jun 10, 2022
12 tasks
ti-chi-bot pushed a commit that referenced this issue Jun 13, 2022
@ywqzzy ywqzzy mentioned this issue Jun 13, 2022
12 tasks
ti-chi-bot pushed a commit that referenced this issue Jun 13, 2022
@JaySon-Huang JaySon-Huang mentioned this issue Sep 5, 2022
12 tasks
ti-chi-bot pushed a commit that referenced this issue Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/code-quality-improvement PR that can improve the code quality
Projects
None yet
Development

No branches or pull requests

4 participants