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

Change includes to improve desbordante performance #531

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PodushkaPIR
Copy link

  • Add includes to the files that are used
  • Add forward declarations
  • Remove includes that aren't used or to add their components

About include comments: it's temperary and they don't make sense.

- Add includes to the files that are used
- Add forward declarations
- Remove includes that aren't used or to add their components
Copy link
Collaborator

@vs9h vs9h left a comment

Choose a reason for hiding this comment

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

I understand that the pull request is still in draft status. I noticed some small points, they need to be addressed.

At the same time, I want this pull request to help developers and reviewers in the future. I would like to bring up several questions for discussion:

  1. It would be good to automate this thing if possible. As I see, you used iwyu to fix the problem with includes. How well does it work, how many manual corrections need to be made, etc.? Will it be possible to add it to the CI?
  2. It would be good to see how this problem is solved in large projects. Probably, it is possible to find projects that can be used as an example in this regard. Do they use this tool, do they add it to CI or any alternative tools?
  3. It is interesting that we are trying to use forward declarations where possible. I would like to understand how justified this is, since Google Code Style, for example, clearly says to avoid them. If we get a good gain in project compilation time, then that's one thing (have you noticed a reduction in compilation time?). If not, then it's worth thinking about it some more. And in general, it's interesting to learn about best practices regarding this.
  4. In the end, it would be good to also get some kind of guide for developers (to our wiki), which will describe some of the subtleties regarding our agreements on how we write includes.

Comment on lines +13 to 16
#include "algorithm.h" // for Algorithm
#include "algorithm_types.h" // for AlgorithmType
#include "algorithms/create_algorithm.h"
#include "algorithms/pipelines/typo_miner/typo_miner.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Most likely we want to use the current style of writing paths (relative to the "src/core").

#include "create_algorithm.h" // for GetAllDerived
#include "csv_config_util.h" // for MakeInputTable
#include "fd/fd.h" // for FD
#include "gtest/gtest.h" // for Message, Ass...
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's interesting that here we see a duplicate include without angle brackets. I don't know why this occurs.

It would be good to check that there are no similar problems?

Comment on lines 122 to 123
{kFdReduced30, 275990379954778425U},
{kFlight1k, 2512091017708538662U},
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: let's change indent here too

Comment on lines +13 to +14
#include "../model/list_agree_set_sample.h" // for ListAgreeSetSample
#include "../model/pli_cache.h" // for PLICache
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we are fixing includes, it is probably worth fixing things like this.

At least, this file has "fd/pyrocommon/model/agree_set_sample.h" and "../model/list_agree_set_sample.h". We probably want to use paths relative to "src/core/algorithms/" here.

At the same time, there are probably many similar things throughout the project. Шt would be great to fix all of this with some tools.

#include <chrono>
#include <memory>
#include <stdexcept>
#include <bits/chrono.h> // for duration_cast
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like we should use <chrono>, isn't it?

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