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
Morbo does not ignore .swp files anymore #934
Comments
Is this the wrong place to ask? |
I just upgraded 6.41 -> 6.55 and found the same issue. Morbo is restarting whenever I type anything. I have reverted back to 6.41 for now. |
We know about the issue. It can be fixed with this patch:
Need to decide if this is the right thing to do. |
The patch is working, thanks. It looks like a nice solution to me. I don't think anybody puts application code in dotfiles. But if you want to be conservative you could enable it via a --ignore-dotfiles switch. |
Yes, the patch works. |
👍 for @jhthorsen 's patch as long as it includes some documentation somewhere |
👍 from me too |
You don't think it might be problematic that this can't handle directories like |
hmmmm, yeah, handling |
I supposed stat() is a lot slower than calling a perl function. What do you mean with "can't handle directories like .git" @kraih ? Do you mean |
As @jberger pointed out in #mojo earlier, here is what plack does: https://metacpan.org/source/MIYAGAWA/Plack-1.0039/lib/Plack/Loader/Restarter.pm#L55 I think something like this is a middle way:
But it requires more tests, hehe |
@jhthorsen I mean it doesn't ignore files inside a directory with dot prefix, like |
@jhthorsen makes a point about |
Yeah, I think the regex is a mess as well. Let's not make it more complicated than we have to, and currently users are complaining about dotfiles. I'm +1 on the patch, since it's simple and makes morbo behave like it used before ea8dc33#diff-52d3ad944c9afec616d8ccbcc2f1ce2eL48 |
I would be interested some performance metric if possible. |
@jhthorsen I don't think that is true, it looks like the old code used to ignore directories with a dot prefix too. |
Note that i'm not saying it should ignore directories like |
Quick benchmark for the Mojolicious repo on OS X with SSD.
|
Almost forgot, these are the results with @jhthorsen's patch applied. So there's a very noticeable performance cost.
But if the dot prefix check gets moved behind the mtime/size check, it jumps back to |
New patch:
Benchmark on 5163 files with n=50:
Here is more information from the discussion on IRC: http://irclog.perlgeek.de/mojo/2016-03-14#i_12180034 |
Just wanted to mention that @jhthorsen's latest patch should also result in the deprecation of |
This should really be two issues, the first about ignoring dotfiles efficiently with the current code, and the second about optimizing Morbo by deprecating |
Is there no way to ignore file via pattern? is this wrong place to ask? |
I have just updated Mojolicious and now Morbo does not ignore the .swp files created by Vim anymore. Is this a bug?
The text was updated successfully, but these errors were encountered: