Ruby On Rails is slow…?

后端 未结 11 1822
说谎
说谎 2021-01-31 23:50

I\'m writing a web application to monitor a furniture factory production flow. It has thousand of data to handle. So far, I run RoR on Mongrel + MySQL and it\'s really really sl

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-31 23:57

    This is not normal. You have some logic that is slowing you down. Trying commenting out bits and pieces of your code that you think are taking a long time and see if that helps. If it does then you need to figure out how to optimize that logic.

    If you are doing lots of calculations over a loop iterating through a very large number of objects, then of course it will be slow.

    These types of issues can come up in any language or framework. While Ruby is not as fast as other languages, it's fast enough most of the time. If you need to constantly calculate with large data sets then Ruby may not be the right language for you. Look into writing a Ruby C extension that will handle your performance draining code. But first just try to diagnose and refactor.

    Lastly, check out RubyProf to see if it can help you find the bottleneck.

提交回复
热议问题