I have been using Drupal for a while to build medium to large CMS systems; love it. From time to time I have to build a RestAPI. Usually I use either Laravel, Lumen or Slim. The only reason why I don't use Drupal is because the bootstrap / overhead is so high in Drupal.

What can be done to make this bootstrap / overhead less. I fully understand that we will never get to the same lean and mean footprint that you get from a dedicated RestAPI framework - but surely we can make the bootstrap faster / smaller / quicker?


In drupal 7 you can use a contrib module called services, this will help you expose json by default for all nodes. You can also output main from hook_menu.

If you use laravel you may be more comfortable drupal 8, its built on symfony and supports test out of the box

  • Good suggestion; need an excuse to get into D8 – JP Dippenaar Feb 15 '16 at 8:25
  • No problem. Drupal 8 is really good. Way much more like Laravel. Please could you mark an answer as correct? – Kevin howbrook Feb 15 '16 at 11:58

Most of the speed costs to Drupal (beyond php as a language) are from the render layer.

If using Drupal just as a RESTful api, having fewer modules enabled (i.e. Views plugins) will likely cut down on your costs.

Having said that, in non-trivial use cases, I have to imagine the bootstrap is a much smaller performance hit relative to DB queries.

  • Thanks - I think that is fair enough. Guess best would be to give it a try with a simple API and then bench-mark. – JP Dippenaar Feb 15 '16 at 8:25
  • I'd sort of be interested in seeing the results, but I'm too lazy to test the differences. Also, I don't know what the differences are between Drupal 8 and 7 in regards to the performance. – DJW Feb 15 '16 at 15:00
  • I will 'book-mark' this question and if I get the chance to benchmark the 3 on a small API I will post my results. – JP Dippenaar Feb 15 '16 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.