{"id":8182,"date":"2017-10-02T06:00:45","date_gmt":"2017-10-02T10:00:45","guid":{"rendered":"https:\/\/blog.litespeedtech.com\/?p=8182"},"modified":"2017-10-02T06:00:45","modified_gmt":"2017-10-02T10:00:45","slug":"developers-corner-why-use-litespeed-quic-library","status":"publish","type":"post","link":"https:\/\/lswp.store\/index.php\/2017\/10\/02\/developers-corner-why-use-litespeed-quic-library\/","title":{"rendered":"Developer&#8217;s Corner: Why Use LiteSpeed QUIC Library"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" title=\"\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/09\/null-7.png\" alt=\"\" width=\"624\" height=\"312\" \/><\/p>\n<p>Projects and individuals <a href=\"https:\/\/daniel.haxx.se\/blog\/2016\/07\/20\/curl-wants-to-quic\/\">have<\/a> <a href=\"https:\/\/stackoverflow.com\/questions\/17896432\/is-there-a-standalone-library-for-googles-quic\">expressed<\/a> <a href=\"https:\/\/bugs.debian.org\/cgi-bin\/bugreport.cgi?bug=841848\">interest<\/a> in having a standalone QUIC library. The newly-released <a href=\"https:\/\/github.com\/litespeedtech\/lsquic-client\">LiteSpeed Client Library<\/a> is a good choice for many applications.<\/p>\n<p>When it comes to selecting a working QUIC library, one has few choices:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/litespeedtech\/lsquic-client\">lsquic<\/a> &#8212; standalone QUIC client library;<\/li>\n<li><a href=\"https:\/\/github.com\/google\/proto-quic\">proto-quic<\/a> &#8212; standalone QUIC client and server library; and<\/li>\n<li><a href=\"https:\/\/github.com\/lucas-clemente\/quic-go\">quic-go<\/a> &#8212; standalone client and server library.<\/li>\n<\/ul>\n<p>quic-go may be inconvenient to incorporate if you do not use the Go programming language and I will not comment upon this library further in this post.<\/p>\n<p>Since the time it was first released in April of last year, proto-quic has been utilized in some projects. Now that Google <a href=\"https:\/\/groups.google.com\/a\/chromium.org\/forum\/#!topic\/proto-quic\/cILnSdQrewU\">no longer maintains<\/a> proto-quic, these projects have a choice to make: maintain proto-quic, or their derivative thereof, themselves or switch to the newly-released LiteSpeed Client Library. For those that have not yet decided which QUIC library they want to use, I list the arguments in favor of the LiteSpeed implementation below:<\/p>\n<h2>LSQUIC Is Actively Maintained<\/h2>\n<p>The LSQUIC Client Library is maintained, whereas proto-quic is not. Integrating Chromium\u2019s QUIC code into your program requires extracting the relevant bits from Chromium and updating them as new QUIC versions appear. On the other hand, the LSQUIC Client Library is a standalone component that we plan to maintain going forward.<\/p>\n<h2>LSQUIC Is Future-Proof<\/h2>\n<p>We use this code ourselves in our own products. We will continue to support the current line of QUIC versions (Google QUIC) and add support for the <a href=\"https:\/\/quicwg.github.io\/\">upcoming IETF versions<\/a> of QUIC. We are not abandoning this code.<\/p>\n<h2>LSQUIC Is C, proto-quic is C++<\/h2>\n<p>LSQUIC is written in C99, proto-quic in C++11. The LSQUIC Client Library is easy to integrate into both C and C++ projects.<\/p>\n<h2>LSQUIC Offers Versatile APIs<\/h2>\n<h3>Not tied to an event loop<\/h3>\n<p>Our QUIC library is not tied to any specific event loop. In fact, it is not tied to an event loop at all &#8212; you do not have to use an event loop to drive the library.<\/p>\n<h3>BYO networking code<\/h3>\n<p>LSQUIC does not do its own networking. Instead, it provides a simple \u201cpackets in \/ packets out\u201d interface. This makes the library quite flexible. And portable, too.<\/p>\n<h2>LSQUIC Consumes Fewer Resources<\/h2>\n<p>proto-quic consumes more CPU and memory than the LSQUIC Client Library. This is mainly due to two factors:<\/p>\n<ol>\n<li>proto-quic is part of Chromium, the market-leading browser. As a user application, its job is to provide features to the user (usually just one user on the machine); resource use is a secondary consideration. The LSQUIC Client Library, on the other hand, is born from LiteSpeed\u2019s implementation of QUIC on the server side. We designed the library with scalability in mind.<\/li>\n<li>Pioneering &#8212; and experimental &#8212; work on QUIC implementation takes place in Chromium. proto-quic code is full of special cases for various experiments and options that are not used in production. The LSQUIC Client Library implements features and options strictly as required by the protocol.<\/li>\n<\/ol>\n<h2>LSQUIC Codebase Is Small<\/h2>\n<p>The LSQUIC Client Library is approximately 74,000 lines of code (with the core functionality only about 36,000 lines), as counted by <code>wc(1)<\/code>, while Chromium\u2019s QUIC code size is 156,000 lines of code.<\/p>\n<p>I hope this was convincing. All that\u2019s left is to do this:<\/p>\n<pre>git clone https:\/\/github.com\/litespeedtech\/lsquic-client.git<\/pre>\n<p>From the cutting edge, until next time,<\/p>\n<p>LiteSpeed QUIC Team.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Projects and individuals have expressed interest in having a standalone QUIC library. The newly-released LiteSpeed Client Library is a good choice for many applications.<\/p>\n","protected":false},"author":1,"featured_media":8184,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20],"tags":[88,210,238],"class_list":["post-8182","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-performance","tag-developers-corner","tag-open-source","tag-quic"],"jetpack_featured_media_url":"https:\/\/lswp.store\/wp-content\/uploads\/2017\/09\/null-7.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/8182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/comments?post=8182"}],"version-history":[{"count":0,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/8182\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media\/8184"}],"wp:attachment":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media?parent=8182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/categories?post=8182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/tags?post=8182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}