Slow performance

Hi, sometimes when I run middleman or middleman build, nothing happens. The Ruby process uses 100% of the CPU for minutes, but there is no output in the Terminal. This occurs in multiple projects but I don’t know why it occurs sometimes and not other times. Restarting the machine fixes the problem. Do you know how I can debug what is happening?

Mac OS 10.7.5
Ruby 1.8.7
Middleman 3.0.13

I strongly recommend you update to either Ruby 1.9 (for Middleman 3.0.x) or 2.0 (for the upcoming Middleman 3.1.x). The Ruby 1.8 is about to become unsupported by the Ruby community. It is quite old and Apple really needs to update their default install.

Take a look at rbenv, which can be easily installed via homebrew.

1 Like

I have a simular experience, and have found it (somewhat) related to referring to current_page and sitemap from within classes defined either in HelperMethods or ClassMethods. Possibly it has something to do with current_page/sitemap having access to such huge amounts of data (every resource of the site), so a bug may put a considerable load on the computer and possibly lead to recursion in unexpected ways.

Like you describe, Ruby process uses 100% but nothing happens. Sometimes there is a timeout, others not.

I’ve tried simplifying the code, to get a sample for debugging, but as soon as the code gets simpler this mysterious limbo-behavior also disappear, and it either works or errors are reported the normal way.

I’m not sure Middleman is to be blamed. Actually I’m not at all sure what is to be blamed, but most likely it’s my coding. I just wanted to report that I’ve seen simular behavior.

Mac OS 10.8.3
Ruby 1.9.3-p392
Middleman 3.1.0.beta

We’ve found and recently fixed a pretty bad performance issue with the 3.1 betas, this will be fixed in the next release candidate.