Mutuelinvestor
Mutuelinvestor

Reputation: 3538

Rails Application Performance Rake Task vs Application Method

I have a rails application that currently includes a rake task that goes to a website and does some screen scraping and then creates several records in a table. When I run this particular script, it takes approximately 10 seconds to complete. This performance is too slow and doesn't meet my application requirements. (note: This performance was achieved running the rake task from the command line).

Question - If were to convert the rake task to a regular application method, should expect improved performance and if so, why?

Upvotes: 0

Views: 384

Answers (1)

Trung Lê
Trung Lê

Reputation: 5236

IMHO, split the rake task to regular runner apps would not improve the performance. It is because you still have to load up all components of rails and that's slow. I'd suggest you look into optimising your algorithmic logic.

If tasks that could not be run faster, you should run them as background jobs with DelayedJobs or Resque or cron.

Upvotes: 2

Related Questions