-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
Fix repo location of rubyspec #508
Conversation
* Fix bug exposed by new rubyspec location * Fix excludes on corpus to actually *do stuff*.
d298e92
to
7b5a209
Compare
@dkubb Ready for review. |
7b5a209
to
94fd574
Compare
94fd574
to
8315a4d
Compare
bcfd04a
to
8315a4d
Compare
# @return [Array<Pathname>] | ||
def effective_ruby_paths | ||
paths = Pathname | ||
.glob(repo_path.join('**/*.rb')) |
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.
Think this glob string could be hoisted up into a constant?
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.
Yes. Just like the other ones.
@mbj I finished a pass over this PR |
@@ -1,14 +1,14 @@ | |||
--- | |||
- name: rubyspec | |||
namespace: Rubyspec | |||
repo_uri: 'https://github.com/rubyspec/rubyspec.git' | |||
repo_uri: 'https://github.com/ruby/rubyspec.git' |
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.
Has development on the rubyspec/rubyspec
repo stopped while the ruby/rubyspec
one continued?
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.
The repo disappeared. Yes. And I found ruby/rubyspec
to be the successor.
f90f541
to
49f807c
Compare
@dkubb Ready for the next pass. |
paths = Pathname | ||
.glob(repo_path.join(RUBY_FILE_PATTERN)) | ||
.sort_by(&:size) | ||
.reverse |
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 know this was in the previous code but I'm curious, why do you sort and reverse here?
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.
In the following explanation I'll refer to the files in the corpus as item.
On large parallel, blocking (as in all parallel computations have to finish before we can move on) computations we ideally want to have the work most evenly distributed between the concurrent threads and they should all terminate the same moment.
So in the worst case one thread out of N is just, before all others finish their last item starting to process the item with the longest computation time. Adding significantly to the total runtime of the parallel computation in the most inefficient way.
We can avoid this worst case scenario (and also improve the average case!) via making sure that only small items are left when the queue drains, via starting to produce the heavy items early.
Now as part of processing an item in this specific computation we have the problem that we cannot easily estimate the weight of an item. A big file could also be made out of comments that cause no mutations.
But it turns out that using the file size as a cheap to check property is a good approximation to use this optimization.
You can try this for yourself and remove the optimization noticing that we slice some seconds of the overall runtime with this simple thing.
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.
Very interesting. Thanks for explaining
@mbj I will be ready to merge this once https://github.com/mbj/mutant/pull/508/files#r48119998 is done, and the build is green. |
I hope I get to it today, all under the "on vacation" indeterminism. |
Of course, no pressure. |
25f393f
to
0bbf264
Compare
@dkubb Ready for the next pass. |
@@ -10,10 +10,18 @@ module MutantSpec | |||
# | |||
# rubocop:disable MethodLength | |||
module Corpus | |||
TMP = ROOT.join('tmp').freeze | |||
EXCLUDE_GLOB_FORMAT = '{%s}'.freeze | |||
RUBY_GLOB_PATTERN = '**/*.rb' |
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.
Can we freeze this?
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.
Yes.
31ee858
to
dbf7869
Compare
@dkubb Ready for the next pass. |
You can also remove |
# @return [Array<Pathname>] | ||
def excluded_paths | ||
Pathname.glob(repo_path.join(EXCLUDE_GLOB_FORMAT % exclude.join(','))) | ||
end | ||
|
||
# Number of parallel processes to use | ||
# | ||
# @return [Fixnum] | ||
def parallel_processes |
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 realize this isn't changed in this diff, but I wondered why this needs to be an instance method?
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.
Its a helper method, and I do not want to make it part of the public API of the corpus class just to avoid having it as a helper method.
No Public API > "Bad" private API.
I wounder if the code should raise when an exclude does NOT trigger. But will delay that for the next iteration. |
be2720f
to
fe1deba
Compare
3bcf025
to
1d1cbb3
Compare
No description provided.