<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mv="http://macVmlSchemaUri" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Courier New";
        panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:sans-serif;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:147327082;
        mso-list-template-ids:245935450;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Here are the steps for those that want to review the performance of HTTPParser.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">&nbsp;<o:p></o:p></span></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoNormal" style="mso-list:l0 level1 lfo1"><span style="font-size:11.0pt;font-family:Calibri">git clone
<a href="https://github.com/smithmicro/HTTPParser.git">https://github.com/smithmicro/HTTPParser.git</a><o:p></o:p></span></li><li class="MsoNormal" style="mso-list:l0 level1 lfo1"><span style="font-size:11.0pt;font-family:Calibri">in the directory, run “swift package generate-xcodeproj”<o:p></o:p></span></li><li class="MsoNormal" style="mso-list:l0 level1 lfo1"><span style="font-size:11.0pt;font-family:Calibri">open HTTPParser.xcodeproj in Xcode 8.1<o:p></o:p></span></li><li class="MsoNormal" style="mso-list:l0 level1 lfo1"><span style="font-size:11.0pt;font-family:Calibri">Select “bench” from the target dropdown list<o:p></o:p></span></li><li class="MsoNormal" style="mso-list:l0 level1 lfo1"><span style="font-size:11.0pt;font-family:Calibri">Select Profile from the Product menu<o:p></o:p></span></li><li class="MsoNormal" style="mso-list:l0 level1 lfo1"><span style="font-size:11.0pt;font-family:Calibri">Choose Time Profiler, then record<o:p></o:p></span></li></ul>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Attached is a screenshot showing 5.5% being spent in swift_release, and 2.7% percent in swift_bridgeObjectRetain.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">I will be interesting to try the suggestions that Helge has pointed out here:<o:p></o:p></span></p>
<p class="MsoNormal"><u><span style="font-size:11.0pt;font-family:Calibri"><a href="https://github.com/swift-server/work-group/pull/52">https://github.com/swift-server/work-group/pull/52</a></span></u><span style="font-size:11.0pt;font-family:Calibri"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Dave<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">P.S.&nbsp; If you want to just run the program in Xcode to see the performance, switch to Release build configuration.<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:8.5pt;font-family:Calibri;color:#7F7F7F"><o:p>&nbsp;</o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size:8.5pt;font-family:Calibri;color:#7F7F7F"><o:p>&nbsp;</o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size:8.5pt;font-family:Calibri;color:#7F7F7F"><img border="0" width="687" height="276" id="Picture_x0020_1" src="cid:image001.png@01D2456F.20C20BC0"></span></b><span style="font-size:11.0pt;font-family:Calibri"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span>
</b><span style="font-family:Calibri;color:black">&lt;swift-server-dev-bounces@swift.org&gt; on behalf of Michael Gottesman via swift-server-dev &lt;swift-server-dev@swift.org&gt;<br>
<b>Reply-To: </b>Michael Gottesman &lt;mgottesman@apple.com&gt;<br>
<b>Date: </b>Monday, November 21, 2016 at 3:38 PM<br>
<b>To: </b>Chris Bailey &lt;BAILEYC@uk.ibm.com&gt;<br>
<b>Cc: </b>&quot;swift-server-dev@swift.org&quot; &lt;swift-server-dev@swift.org&gt;<br>
<b>Subject: </b>Re: [swift-server-dev] HTTP Parser<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Nov 21, 2016, at 5:55 AM, Chris Bailey via swift-server-dev &lt;<a href="mailto:swift-server-dev@swift.org">swift-server-dev@swift.org</a>&gt; wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;">&gt;&gt;
</span><tt><span style="font-size:10.0pt">But it sounds like MIT licensed code can’t be used as part of the effort, maybe that should be added the the front-page of the effort.</span></tt>
<br>
<br>
<span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;">I'm not 100% convinced this is true. There's nothing (legally) preventing the inclusion of MIT licensed code in a Apache 2.0 licensed product, you just may have to list some Product Unique Terms
 (PUTs) to cover it - we don't need the Node.js community to dual-license it for us to use it. Parts of the Swift toolchain already have compiled-in dependencies on MIT licensed code, so my guess is that ship has already sailed on using non-Apache 2.0 licensed
 code.</span> <br>
<br>
<span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;">Having said that, we'd obviously need a read and approval from the Swift Core Team (and Apple legal!) before making a compiled-in dependency on anything.</span>
<o:p></o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">We want a consistent license over the entire code base. I imagine we will make an external test suite that will be in a different repository so this will not be an issue.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Originally we put the swift perf test suite in the swift tree since people kept on breaking it. Since we use PR testing this is no longer an issue (the benchmarks are built as apart of the PR testing). There are some questions around how
 this is done/who is it done by/when is it down, that will need to be answered before I can move forward with this.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Michael<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><br>
<span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;">Chris</span> <br>
<br>
<br>
<br>
<span style="font-size:7.5pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;;color:#5F5F5F">From: &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="font-size:7.5pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;">Helge Heß via swift-server-dev &lt;<a href="mailto:swift-server-dev@swift.org">swift-server-dev@swift.org</a>&gt;</span>
<br>
<span style="font-size:7.5pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;;color:#5F5F5F">To: &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="font-size:7.5pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;">&quot;<a href="mailto:swift-server-dev@swift.org">swift-server-dev@swift.org</a>&quot; &lt;<a href="mailto:swift-server-dev@swift.org">swift-server-dev@swift.org</a>&gt;</span>
<br>
<span style="font-size:7.5pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;;color:#5F5F5F">Date: &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="font-size:7.5pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;">20/11/2016 18:08</span>
<br>
<span style="font-size:7.5pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;;color:#5F5F5F">Subject: &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="font-size:7.5pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;">Re: [swift-server-dev] HTTP Parser</span>
<br>
<span style="font-size:7.5pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;;color:#5F5F5F">Sent by: &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="font-size:7.5pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;"><a href="mailto:swift-server-dev-bounces@swift.org">swift-server-dev-bounces@swift.org</a></span>
<o:p></o:p></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="100%" noshade="" style="color:#AAAAAA" align="center">
</div>
<p class="MsoNormal"><br>
<br>
<br>
<tt><span style="font-size:10.0pt">Hi Dave,</span></tt><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><br>
<br>
<tt>thanks for your post, this detail is indeed quite helpful.</tt><br>
<br>
<tt>I don’t think anyone seriously suggested using a Swift port of the http_parser but instead just the upstream C one. But it sounds like MIT licensed code can’t be used as part of the effort, maybe that should be added the the front-page of the effort.</tt><br>
<br>
<tt>I assume it is not a huge issue though as a libhttp_parser can be shipped separately from Swift itself, similar to what you would do for OpenSSL etc (and what is already being done with libcurl on Linux).</tt><br>
<br>
<tt>In any case: Whatever is decided, it at least establishes a performance characteristic, I think any replacement should accomplish a comparable one - preferably faster of course :-)</tt><br>
<br>
<tt>hh</tt><br>
<br>
<br>
<tt>&gt; On 20 Nov 2016, at 16:58, David Sperling via swift-server-dev &lt;<a href="mailto:swift-server-dev@swift.org">swift-server-dev@swift.org</a>&gt; wrote:</tt><br>
<tt>&gt; </tt><br>
<tt>&gt; I would like to provide some additional detail to the discussion on November 4 (which I missed since I joined recently).</tt><br>
<tt>&gt; </tt><br>
<tt>&gt; The team pointed out this thread in Kitura which I initially opened:</tt><br>
<tt>&gt; </tt></span><a href="https://github.com/IBM-Swift/Kitura-net/issues/52"><tt><span style="font-size:10.0pt">https://github.com/IBM-Swift/Kitura-net/issues/52</span></tt></a><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><br>
<tt>&gt; </tt><br>
<tt>&gt; Here is the referenced Swift http_parser project which I initially ported as a thought experiment. &nbsp;The goals, API and performance are described in the readme.</tt><br>
<tt>&gt; </tt></span><a href="https://github.com/smithmicro/HTTPParser"><tt><span style="font-size:10.0pt">https://github.com/smithmicro/HTTPParser</span></tt></a><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><br>
<tt>&gt; </tt><br>
<tt>&gt; Michael Gottesman from Apple (@gottesmm) contacted me 2 weeks ago to see if we could add the project into the Swift Benchmark Suite. &nbsp;See the bottom of this PR for the request:</tt><br>
<tt>&gt; </tt></span><a href="https://github.com/IBM-Swift/Kitura-net/pull/55"><tt><span style="font-size:10.0pt">https://github.com/IBM-Swift/Kitura-net/pull/55</span></tt></a><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><br>
<tt>&gt; </tt><br>
<tt>&gt; Michael and I approached the Node.js Foundation to see if they were willing to dual license http_parser under Apache 2 so it would be compatible with the Swift license. &nbsp;Here is that discussion, but in summary, a dual license is not realistic.</tt><br>
<tt>&gt; </tt></span><a href="https://github.com/nodejs/http-parser/issues/344"><tt><span style="font-size:10.0pt">https://github.com/nodejs/http-parser/issues/344</span></tt></a><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><br>
<tt>&gt; </tt><br>
<tt>&gt; So, a http_parser Swift port:</tt><br>
<tt>&gt; - Would not have the proper license to be included in Swift</tt><br>
<tt>&gt; - Does not take full advantage of Swift</tt><br>
<tt>&gt; - Has the issues previously pointed out (UnsafePointers, asserts, throws simulating gotos)</tt><br>
<tt>&gt; - Does, however, demonstrate a Swift HTTP parser performance of 500K requests per second</tt><br>
<tt>&gt; </tt><br>
<tt>&gt; </tt><br>
<tt>&gt; Looking forward to meeting everyone on our call tomorrow. &nbsp;Hopefully this detail was helpful.</tt><br>
<tt>&gt; </tt><br>
<tt>&gt; </tt><br>
<tt>&gt; Dave Sperling</tt><br>
<tt>&gt; Smith Micro</tt><br>
<br>
<tt>_______________________________________________</tt><br>
<tt>swift-server-dev mailing list</tt><br>
<tt><a href="mailto:swift-server-dev@swift.org">swift-server-dev@swift.org</a></tt><br>
</span><a href="https://lists.swift.org/mailman/listinfo/swift-server-dev"><tt><span style="font-size:10.0pt">https://lists.swift.org/mailman/listinfo/swift-server-dev</span></tt></a><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><br>
</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;,&quot;serif&quot;"><br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number 741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU<br>
</span>_______________________________________________<br>
swift-server-dev mailing list<br>
<a href="mailto:swift-server-dev@swift.org">swift-server-dev@swift.org</a><br>
https://lists.swift.org/mailman/listinfo/swift-server-dev<o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
</div>
</body>
</html>