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

Move validations out of ConanFileReference class. #3509

Closed
1 task done
jgsogo opened this issue Sep 7, 2018 · 2 comments
Closed
1 task done

Move validations out of ConanFileReference class. #3509

jgsogo opened this issue Sep 7, 2018 · 2 comments
Milestone

Comments

@jgsogo
Copy link
Contributor

jgsogo commented Sep 7, 2018

  • Conan 1.7.3

Each time a ConanFileReference is instantiated, all validations are performed (several regex and type checking), even though they have been already validated: internal data, response from APIs,... and this happens a lot of times while evaluating the dependencies graph.

So these validations can be moved to Conan inputs when the reference string is first read into the Conan ecosystem. This can contribute to performance.

@jgsogo jgsogo self-assigned this Sep 10, 2018
@jgsogo
Copy link
Contributor Author

jgsogo commented Sep 10, 2018

An easy implementation would be to make validation optional (True by default), so we can avoid calling to it from places where we know that the fields are valid. It would require little changes in ConanFileReference and PackageReference, like the ones proposed in this branch: https://github.com/jgsogo/conan/tree/engineering/3509.

...but, knowing where the reference is valid and where it may not requires a deep understanding of Conan itself.

@jgsogo jgsogo removed their assignment Sep 10, 2018
@memsharded
Copy link
Member

Yes, I think it is a good initial iteration, low risk. Start checking where the validation is not required, and slowly change them to False. Once it is stabilized, we could really refactor and clean it.

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

3 participants