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

Probably needs some refactoring? #815

Open
artiomn opened this issue Aug 13, 2024 · 2 comments
Open

Probably needs some refactoring? #815

artiomn opened this issue Aug 13, 2024 · 2 comments

Comments

@artiomn
Copy link
Contributor

artiomn commented Aug 13, 2024

Possible improvements:

  • Split large source files into several smaller ones.
  • Remove useless C includes like string.h.
  • Move some includes (like <sys/_cpuset.h>) under extern "C" {}.
  • Split classes and methods.
  • Move *nix and Windows code into separate files or static libraries.

I suggest make a list of improvements so that later can add a separate issue for each of them.

@rdementi
Copy link
Contributor

thank you for the suggestions. Those refactorings are a good thing to do. As you can imagine we are also developing the support of next gen CPUs in PCM internally. If one restructures the code in this repository then this needs to be re-done in the internal version as well. In my experience this can't be done automatically by git for larger changes, there were many merge conflicts which had to be resolved manually. If you would like to contribute I would suggest to start with smaller things which are unlikely to conflict:

  • Remove useless C includes like string.h.
  • Move some includes (like <sys/_cpuset.h>) under extern "C" {}.

@artiomn
Copy link
Contributor Author

artiomn commented Aug 28, 2024

In my experience this can't be done automatically by git for larger changes, there were many merge conflicts which had to be resolved manually.

Of course, this cannot be done automatically. You are right.
I'm not familiar with the development process in your company or department, so I can't give specific advices.

But I can try to help with the code, since I worked on a large project (hundreds of millions of lines of code in ancient C++).
A common way to work with a process when you have two main repositories that you can make changes to is to separate the relatively constant part from the changing parts, for example adding new CPUs as plugins.

If you would like to contribute I would suggest to start with smaller things which are unlikely to conflict:

Ok, I'll try to do it.
Big refactoring is hard, but I think it can be useful in the future as the project grows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants