Boost logo

Boost :

Subject: Re: [boost] [http] Design ideas for a request router
From: Rodrigo Madera (rodrigo.madera_at_[hidden])
Date: 2016-03-15 13:02:36


On Tue, Mar 15, 2016 at 12:19 AM, Gavin Lambert <gavinl_at_[hidden]>
wrote:

> On 15/03/2016 15:58, Rodrigo Madera wrote:
>
>> However, on the technical side, I'm more on the idea that everything that
>> can be done at compile time, should be done at compile time. Handlers,
>> even
>> routes, should be handled in compile time. [1]. This is C++, after all.
>>
>
> While compile time should be the preferred option, it still must be
> possible to modify routes (and other things) at runtime as well (even if
> that requires adding a "dynamic_route" rule at compile time or similar).
>

I agree that runtime configuration is a primary concern. However, I beg to
differ on privileging compile times over (possibly) more efficient code. If
possible, make this a define so the user can choose at will.

I'd rather invest in very good hardware and have very optimized code than
to have small compile times and leave some paths sub optimal at runtime. I
don't wish to be extreme, of course, but C++11 and up make this
meta-programming burden quite faster. It won't always be possible to get
that extra gain, but it's worth a try IMHO.

> The majority of cases will work fine with static routes, but dynamic ones
> are sometimes needed too, and can't be ignored.

Agreed.

Madera


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk