On Mon, 15 Dec 2014 16:05:05 GMT, Bryan Wisdom wrote:

Thank you for your assistance.

My Question:
Why does my REST service seem to perform so poorly using rest interfaces in dlang vibe.d when compared to creating request handlers manually?

Hi,
Thanks for reporting the issue. It's hard to tell exactly from the code you posted, would you be willing to upload a test case somewhere (like a github repository) ? That would make it way easier to debug :)

From what I can see, there are 2 possibles causes:

  • The manual handler don't have to look routes up. Every request is directly mapped to your request handler.
  • Return from REST interface are always serialized (most likely the cause of the issue).

Again, if you upload an usable test case to github, I'll look into it.

Also, side note:

Server:

auto routes = new URLRouter;      

registerRestInterface(routes, new ArtifactArchive());

auto settings = new HTTPServerSettings();

settings.port = port;
settings.bindAddresses = [host];
settings.options |= HTTPServerOption.distribute;

listenHTTP(settings, routes);

runEventLoop();

I believe this code is in your module ctor (static shared this()) ? If so, you should not call runEvenLoop from here. If not, just ignore this comment :)