On 26. 11. 2026 11:38, Yann Ylavic wrote:
On Thu, Nov 26, 2026 at 9:51 AM Ruediger Pluem via dev
<[email protected]> wrote:
Can't we even speed up things more for https by

Instead of

     case 'h': case 'H':
         if (!apr_cstr_casecmp(scheme_str, "http"))
             return APR_URI_HTTP_DEFAULT_PORT;
         if (!apr_cstr_casecmp(scheme_str, "https"))
             return APR_URI_HTTPS_DEFAULT_PORT;
         break;
using


     case 'h': case 'H':
         if (!apr_cstr_casecmpn(scheme_str, "http", 4))
             switch (scheme_str[4]) {
                case '\0':
                   return APR_URI_HTTP_DEFAULT_PORT;
                case 's': case: 'S':
                   return APR_URI_HTTPS_DEFAULT_PORT;
             }
         break;
Yes, my latest version (attached) is something like this. Not sure
Branko will like it though, to me it reads better than the previous
one :p

No, I won't like it, but I also won't keep harping on that. If everyone else is happy with having such unmaintainable code in the tree, I won't go against consensus. I will, however, point out that you're doing this optimisation – which I admit is twice as fast as the perfect hash – based on, let me see, I think it's exactly zero metrics from real-world usage.

But that's fine.

-- Brane

Reply via email to