From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id ACB191F5B1 for ; Mon, 20 Jul 2020 09:18:57 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id a14so2211399wra.5 for ; Mon, 20 Jul 2020 02:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopify.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rpFXUYZ3q4lZjc+68OyzTWRfypJYmfjVAkIOnOiqy7w=; b=PxtHFbs8NlJsPWAJsjWdpnd4jPyTG/YsLw49pgEk4Kug7v8AspRBhxD841QS3haH4Z CQuMS0yBDeI1cUZmb3jyBJL4dh9crD6rEQQfR/HS8quCOOowVWPEiuawOQVlUcnyIRhY 2FOEtq3eX/vEv6u5S63jIjX7h7bR7zN64Uo9E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rpFXUYZ3q4lZjc+68OyzTWRfypJYmfjVAkIOnOiqy7w=; b=rVUh0lJEiv/9e2kWHRyPAc3Y+Q7LDYnSXdc9rQeJgtnpHPD/5tXXspSmDsuZP93iDp rdKGWzhFuDG/MkojH9cCOCLqRTHbf87+MrToKrvPA8LUbGNMEiQxjr4mAQgmmK2b0bsM JJBbovIeiyZOQiJ90sRp9IUwpI7oJIby1FaI2bLZn3ewsOlUuX6uXQTgT2zo/hjON6D3 CPBOidHAHmgjFDqgsDSqSqLDI/ZsctlZMsdAl3SWhsSdgkhgFQxyIkSlathWqfWSHuVq NiVkgJTRLgiybnvJ9FZTMg1L+Q7L4AxE4aTa2+Wy6PDy5BGOHhrhrCiYGICaWYUOqRFE uNcQ== X-Gm-Message-State: AOAM532j3G+1+vJNqZEAsKpOKHwfrJ21QfKRTjSAcH0jTZ/BKsto96gF SknW7i33scvN5VB8YqTWWdZGtA== X-Google-Smtp-Source: ABdhPJw8JRONqQ+a/VUrurncBLUN2Fl4ouv0p5IDFhAqjW4gJtWxiuu8RtXX6ZopDd4ic3ZYXrFh0w== X-Received: by 2002:adf:ded0:: with SMTP id i16mr6522276wrn.389.1595236735063; Mon, 20 Jul 2020 02:18:55 -0700 (PDT) Received: from [192.168.0.12] (87-231-62-161.rev.numericable.fr. [87.231.62.161]) by smtp.gmail.com with ESMTPSA id a22sm29879989wmj.9.2020.07.20.02.18.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jul 2020 02:18:54 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH] Add early hints support From: Jean Boussier In-Reply-To: <20200717011955.GA23522@dcvr> Date: Mon, 20 Jul 2020 11:18:53 +0200 Cc: unicorn-public@yhbt.net Content-Transfer-Encoding: 7bit Message-Id: <624157B8-884C-42EB-8515-AFC6807D6F8D@shopify.com> References: <058BA238-BEB3-4E54-9DE6-DC59BCB86246@shopify.com> <20200716105037.GA26605@dcvr> <242F0859-0F83-4F14-A0FF-5BE392BB01E6@shopify.com> <20200716121643.GA26942@dcvr> <20200717011955.GA23522@dcvr> To: Eric Wong X-Mailer: Apple Mail (2.3608.80.23.2.2) List-Id: > I guess... I was wondering more in terms of the big picture with > HTTP parsing, I/O, and response generation taken into account. I wasn't too sure how to benchmark the entire loop. But regardless 18/20M i/s shows that it should be meaningless. It's only executed once per request, so would "waste" 1 second for 18 million requests processed. > (and there may be improvements in those areas later this year, > assuming the world doesn't end sooner...) If you are interested in general optimizations, I did spot a bunch of sub optimal patterns, such as `=~` in places where a string comparison, or `match?` would do. However many optimizations are only available on more recent rubies.