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

Poor performance on Windows #28

Closed
Maher4Ever opened this issue Apr 27, 2012 · 24 comments
Closed

Poor performance on Windows #28

Maher4Ever opened this issue Apr 27, 2012 · 24 comments
Assignees

Comments

@Maher4Ever
Copy link
Contributor

The FChange gem is implemented in the default Windows adapter, but it might not be the best choice. It turns out that the polling adapter is a lot faster on Windows than the FChange one (my machine is running ruby 1.9.3-p125 on Windows 7 SP 1). I tried profiling the FChange gem with ruby-prof on WIndows and I found an interesting fact: By attaching a FChange watcher to a directory, a simple touch and rm of a file takes 1.502 sec instead of 0.002, which is more than 99% slower! ( link to code and results )

In light of this discovery I think it would be reasonable to just use the poll adapter as the default one for Windows. What do you think @thibaudgg ?

@thibaudgg
Copy link
Member

Yeah if it's really so much slower using the poll adapter now seems a good decision but it would be if that could be a temporary workaround.

@stereobooster do you have a idea about why rb-fchange is slower than polling?

@stereobooster
Copy link

I have no clue. I need to investigate it.

@Maher4Ever
Copy link
Contributor Author

For anyone interested in helping us get more results on this performance issue, you could download a profile script which has a "how to use" file. The only thing you should have before running the script is a version of ruby installed. You could use this link to get ruby installer, then dev-kit is needed to run the profiler.

@TheDutchCoder
Copy link

@Maher4Ever I have Ruby installed, including the dev-kit, but the instructions in the Read Me file for the profiler don't work for me. 'bundle' is not working (not recognized as a command).

I installed bundler (which is not part of the RubyInstaller for Windows), but then it throws the following error:
F:\Installs\profile-fchange>bundle install
Your Gemfile has no remote sources. If you need gems that are not already on
your machine, add a line like this to your Gemfile:
source 'https://rubygems.org'
Could not find ffi-1.0.11 in any of the sources

Also, the instructions in step 1 aren't totally clear: "... and go to this directory" (I figure "this" is the dir where I extracted the profiler?)

@Maher4Ever
Copy link
Contributor Author

@reinierk Thank you for reporting these issues with the profiling package. I'm too used to having bundler automatically installs itself with each ruby I install that I forgot it's not (yet) a part of ruby.
Anyhow, I just re-installed RubyInstaller from scratch to ensure I have a clean slate and I corrected the script to work with it. I also tried to explain every step more in the instructions.

To make it possible for everyone to help with the script, I made a repository for it. I would appreciate it if you could download the zip from the new repository and give it another try.

@TheDutchCoder
Copy link

@Maher4Ever Thanks for that, makes it easier to understand and good to point out bundler.
Install went fine after that with the new profiler zip and I will try it out and post results in the new repo.

@TheDutchCoder
Copy link

Here are my results!
http://www.x-plicit4.nl/results.zip

@TheDutchCoder
Copy link

@Maher4Ever were my results of any use for you and/or do you want me to do another (couple of) run(s)?

@Maher4Ever
Copy link
Contributor Author

@reinierk Thank you for proving us with your result, it is very helpful and confirms that using FChange incurs a performance penalty for a core ruby method File#initialize. Without FChange, calling that method happens in almost no time, but with FChange there is a delay of 1.5 sec.

@stereobooster Have you had time to look into this issue?

@codylerum
Copy link

I did see this same behavior on 1.9.3 but works fine on ruby 1.9.2p290

@Maher4Ever
Copy link
Contributor Author

@codylerum Can you please provide us with your results for the profiling script with more info about your system? I ran the profiling script on ruby 1.9.2p290 on Window 7 (64bit) and the results were almost identical to the results of ruby 1.9.3.

@codylerum
Copy link

@Maher4Ever I don't seem to be able to install the required "fileutils" even though I have devkit installed (verified by running gem install rdiscount --platform=ruby)

This is on 1.9.2p290

Errors on building rmagick-2.13.1

@Maher4Ever
Copy link
Contributor Author

@codylerum FileUtils is a part of the ruby stdlib, so you don't have to install it. Did you follow the usage instructions on the repo of the profiling script?

@codylerum
Copy link

@Maher4Ever I was running from a link further up in the issue. Let me gather the results

@codylerum
Copy link

@Maher4Ever Results: https://dl.dropbox.com/u/86734110/results.zip

I'm not sure if my issue is performance based or that it just isn't picking up on file modifications in 1.9.3 where it does just fine in 1.9.2

@Elufimov
Copy link

@Maher4Ever https://dl.dropbox.com/u/13579347/results.zip
Windows 4 x64 and ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

@Maher4Ever
Copy link
Contributor Author

I just pushed the source of a new gem I called Windows Directory Monitor (WDM). It's still very experimental, but in my tests it performs faster than any comparable library on Windows. WDM still needs a lot of work, so don't expect it to be ready any time soon.

@ghost ghost assigned Maher4Ever Jul 15, 2012
@mrbinky3000
Copy link

Greetings. I would just like to +1 the performance issue on Windows. This gem is part of Middleman and as a result, it is making Middleman unusable on Windows 7 machines. If there is anything I can do to help out, let me know.

@thibaudgg
Copy link
Member

@mrbinky3000 have you been able to give a try to WDM gem?
@Maher4Ever have you a release date in mind?

@andrew-aladev
Copy link

I've tested @Maher4Ever 's pull request with middleman. it works perfect

@thibaudgg can you make a new release of listen? I will notify @tdreyno to make a new version of middleman too. I am sure that our windows-based designers will be happy ^___^

@Maher4Ever
Copy link
Contributor Author

@thibaudgg I was very busy for the last couple of weeks. I'll try to update WDM docs today and then release a new version of Listen.

@andrew-aladev Great to know WDM fixed your problem :)

@thibaudgg
Copy link
Member

@Maher4Ever no problem, take your time Maher and have a nice week-end. Thanks!

@Maher4Ever
Copy link
Contributor Author

Listen 0.5.0 has been released :)

@thibaudgg
Copy link
Member

@Maher4Ever Awesome!

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

8 participants