-
-
Notifications
You must be signed in to change notification settings - Fork 342
Performance Tweaks #55 #56
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
Conversation
Performance Optimizations issue #55
…romosomeCreateNewNull_Exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, the implementation it's ok as we discussed before, please, just fix the issues list below:
Remove the "OperatorsStrategies" namespace
There is no need to put the IOperatorsStrategy and its implementation in a new namespace. Please, just move them to "GeneticSharp.Domain" namespace.
Code documentation
Please, add code documentation to public members of IOperatorsStrategy and its implementations explaining their propose and use.
The same applies to all new Tpl classes.
TplPopulation
The difference between Population and TplPopulation is only the "CreateInitialGeneration" method?
Whether this the case, please, change TplPopulation to inherit from Population class, just override the "CreateInitialGeneration".
TplTaskExecutor
The difference between ParallelTaskExecutor and TplTaskExecutor is only the "Start" method?
Whether this the case, please, change TplTaskExecutor to inherit from ParallelTaskExecutor class, just override the "Start".
Unit tests
Add unit tests validating the new Tpl classes and the IOperatorsStrategy's implementations.
Solve issues
Please, solve the issues listed on https://sonarcloud.io/project/issues?branch=feature%2Fperformance-tweaks&id=GeneticSharp&resolved=false
Next steps
Feel free to question about any of the sections I pointed above.
After you finish the changes, I will perform another review.
I'm pushing the first part, just wait to review it again, I still need to fix documentation and tests |
How can I force a SonarCloud build? I would like to check the results of my modifications... |
Sonar can be run from tools/runSonar.sh (or .cmd), but it's need a login from https://sonarcloud.io, in this case is my account. You can create a https://sonarcloud.io account for you and change runSonar.sh|cmd to your account details. Anyway, I ran it again from your latest code: https://sonarcloud.io/project/issues?branch=feature%2Fperformance-tweaks&id=GeneticSharp&resolved=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment about the change in DefaultOperatorsStrategy.cs:
- Changed loop use parents.Count, previously was using population. Did it to save from passing population.
… TplTaskExecutor to Ghostwriter as example
src/GeneticSharp.Infrastructure.Framework/Threading/TplTaskExecutor.cs
Outdated
Show resolved
Hide resolved
src/GeneticSharp.Domain/OperatorsStrategies/DefaultOperatorsStrategy.cs
Outdated
Show resolved
Hide resolved
I'm pushing the second part, still wait to review it, I still need to fix documentation and tests. Open Questions:
PS: Can you run the sonarcloud build once again? |
I ran SonarCloud again. |
I've completed the required changes. You can now proceed to review the PR. Thanks, D. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I leave some comments in the code and you need to improve the TpTaskExecutor test coverage:
https://sonarcloud.io/component_measures?branch=feature%2Fperformance-tweaks&id=GeneticSharp&metric=coverage&selected=GeneticSharp%3AGeneticSharp%3A1498D792-D02B-4A9E-8AFC-24AEBA0DEE54%3AThreading%2FTplTaskExecutor.cs
src/GeneticSharp.Domain.UnitTests/Populations/PopulationTest.cs
Outdated
Show resolved
Hide resolved
src/GeneticSharp.Domain/OperatorsStrategies/DefaultOperatorsStrategy.cs
Outdated
Show resolved
Hide resolved
…n_AdamChromosomeCreateNewNull_Exception" This reverts commit 0dd670d.
I think I've completed. Can you run the check on sonarcloud one more time? Thanks |
src/GeneticSharp.Domain/OperatorsStrategies/DefaultOperatorsStrategy.cs
Outdated
Show resolved
Hide resolved
My bad, it's now fixed. |
Thanks for the PR. I will merge it to develop branch. 👍 I need to finish some feature branches from my side, then I'll publish a new release and a nuget package with your contributions. |
Performance Tweaks (PLINQ/TPL) to Genetic Algorithm #55