-
Notifications
You must be signed in to change notification settings - Fork 140
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
Maximum and minimum file size #534
base: dev
Are you sure you want to change the base?
Conversation
@hoelzro : Please don't do anything with this until we've talked. I think I want to freeze new features until we get bugs under control, even cool new features like this one. |
my $n = $1; | ||
if ($2) { | ||
my $u = lc $2; | ||
$n *= 1024 while $u =~ tr/tgmk/gmk/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.
This is pretty clever, but it might be too clever; maybe we should just have a hash of suffixes => number of bytes?
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.
And are we going to distinguish between MB and MiB, GB and GiB?
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.
Ah, I keep being surprised at how decimal things are nowadays. Looks like things like ls -l
defaults to 1K=1000 so I guess yes, we should.
@pdl Thanks for the patch! I took a look and left a few comments on the changes. In addition, you may want to try using the timings script in the dev directory to see how your changes affect the runtime of ack. I would checkout the dev branch, |
Thanks for the feedback! I'll give the timings script a go. Noting your and @petdance's comments (particularly bugs before features), I'll go and fiddle with it some more and come back with something more refined. |
@hoelzro, I'm getting values of
Any ideas what I'm doing wrong? |
@pdl You probably need to check out parrot to your |
Ah, thanks. Assuming you mean https://github.com/parrot/parrot, the timings (as of ea9f26b) look like margin of error difference (I did them in backwards order, sorry, I've adjusted the column heads).
|
This looks pretty good to me; we're in kind of a code freeze at the moment, but after that's done with, one of us can merge it in. |
What is the use case for --min-file-size? I can't think of why one would use it. |
More for completeness than anything but it's plausible that when searching directory structure with so many tiny files (like Dancer YAML session files) and a few large interesting files that the little ones become annoying. |
I don't want to add --min-file-size for completeness. I only want it if it will actually get used, and it seems very unlikely to me. Every bit of code in the project has weight and cost. |
Follows on from discussion in #529.
-s _
.