<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jun Guo</title>
    <description>The latest articles on DEV Community by Jun Guo (@gjuoun).</description>
    <link>https://dev.to/gjuoun</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F391315%2F9516707e-ff4c-46ec-b456-7eddc82cbb62.jpg</url>
      <title>DEV Community: Jun Guo</title>
      <link>https://dev.to/gjuoun</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gjuoun"/>
    <language>en</language>
    <item>
      <title>Publish your Scala library to Github Packages for free</title>
      <dc:creator>Jun Guo</dc:creator>
      <pubDate>Sat, 26 Sep 2020 00:18:06 +0000</pubDate>
      <link>https://dev.to/gjuoun/publish-your-scala-library-to-github-packages-4p80</link>
      <guid>https://dev.to/gjuoun/publish-your-scala-library-to-github-packages-4p80</guid>
      <description>&lt;p&gt;As you may know, Github Packages is a place like &lt;code&gt;npm&lt;/code&gt;, which you can host public and private packages. Currently, Github packages supports lots of build tools like &lt;code&gt;npm&lt;/code&gt;, &lt;code&gt;gem&lt;/code&gt;, &lt;code&gt;mvn&lt;/code&gt;, &lt;code&gt;gradle&lt;/code&gt;, &lt;code&gt;dotnet&lt;/code&gt; (&lt;strong&gt;Free for public libraries&lt;/strong&gt;). However, there is not support for &lt;code&gt;sbt&lt;/code&gt;, which is not very friendly to our &lt;code&gt;scala&lt;/code&gt; developers. Fortunately, thanks to &lt;code&gt;djspiewak&lt;/code&gt; for creating &lt;a href="https://github.com/djspiewak/sbt-github-packages" rel="noopener noreferrer"&gt;sbt-github-packages&lt;/a&gt; plugin. This will allow us to publish our scala library into Github packages. Here is how: &lt;/p&gt;

&lt;h3&gt;
  
  
  🧧 Publish &lt;code&gt;sbt&lt;/code&gt; library to Github Packages
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;We will use &lt;a href="https://github.com/djspiewak/sbt-github-packages" rel="noopener noreferrer"&gt;sbt-github-packages&lt;/a&gt; plugin in this tutorial&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  1. Generate a personal access token with &lt;code&gt;package:write&lt;/code&gt; permission
&lt;/h4&gt;

&lt;p&gt;Get your personal access token in &lt;code&gt;settings - developer settings - personal access token&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F8935612%2F93943795-a0a62f00-fd09-11ea-84b3-ae55a96cd4d5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F8935612%2F93943795-a0a62f00-fd09-11ea-84b3-ae55a96cd4d5.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then goto &lt;code&gt;generate token&lt;/code&gt;, please remember this token, we will use it in step 3.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Add &lt;code&gt;sbt-github-packages&lt;/code&gt; plugin into your existing sbt project
&lt;/h4&gt;

&lt;p&gt;I assume you have a library that is ready to publish. Please add this line to your codebase &lt;code&gt;./project/plugins.sbt&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;addSbtPlugin&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"com.codecommit"&lt;/span&gt; % &lt;span class="s2"&gt;"sbt-github-packages"&lt;/span&gt; % &lt;span class="s2"&gt;"0.5.2"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  3. Set global git &lt;code&gt;github.token&lt;/code&gt; to allow the plugin to work
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; github.user &amp;lt;github_username&amp;gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; github.token &amp;lt;personal_token&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;personal_token&amp;gt;&lt;/code&gt; is the token you just created in &lt;code&gt;step 1&lt;/code&gt;. After executing these commands, you should be able to view it at &lt;code&gt;~/.gitconfig&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;github]
    token &lt;span class="o"&gt;=&lt;/span&gt; &amp;lt;personal_token&amp;gt;
    user &lt;span class="o"&gt;=&lt;/span&gt; &amp;lt;github_username&amp;gt;
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  4. Get ready to publish your package
&lt;/h4&gt;

&lt;p&gt;Add these these lines to your &lt;code&gt;./build.sbt&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;githubOwner :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;github_username&amp;gt;"&lt;/span&gt;
githubRepository :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;github_repo_name&amp;gt;"&lt;/span&gt;
githubTokenSource :&lt;span class="o"&gt;=&lt;/span&gt; TokenSource.GitConfig&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"github.token"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;after adding them you should re-run the build or restart the IDE (if you're using IntelliJ)&lt;/p&gt;

&lt;p&gt;For example, my username is &lt;code&gt;gjuoun&lt;/code&gt; and this repo name is &lt;code&gt;github-packages-playground&lt;/code&gt;. Fill the fields as yours.&lt;/p&gt;

&lt;p&gt;Behind the scene, &lt;code&gt;githubTokenSource := TokenSource.GitConfig("github.token")&lt;/code&gt; reads the github token then the plugin is authorized to publish to Github Packages&lt;/p&gt;

&lt;h4&gt;
  
  
  5. Publish to Github Packages
&lt;/h4&gt;

&lt;p&gt;Run this command to publish your package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sbt publish
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you will see this &lt;code&gt;package&lt;/code&gt; tab available in your repo:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F8935612%2F93931869-bc9fd580-fcf5-11ea-8639-f15b95cc8199.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F8935612%2F93931869-bc9fd580-fcf5-11ea-8639-f15b95cc8199.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All naming conventions are from the variables in &lt;code&gt;./build.sbt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The package name is &lt;code&gt;&amp;lt;organization&amp;gt;.&amp;lt;name&amp;gt;_&amp;lt;scalaVersion&amp;gt;&lt;/code&gt;, the image indicates package version &lt;code&gt;0.1.2&lt;/code&gt; which is from &lt;code&gt;&amp;lt;version&amp;gt;&lt;/code&gt;. &lt;/p&gt;




&lt;h3&gt;
  
  
  🧨 Use sbt package from Github Packages
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;We will use &lt;a href="https://github.com/djspiewak/sbt-github-packages" rel="noopener noreferrer"&gt;sbt-github-packages&lt;/a&gt; plugin in this tutorial&lt;br&gt;
You should have followed step 1-5 above and published your package.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  1. Add &lt;code&gt;sbt-github-packages&lt;/code&gt; plugin to enable sbt to consume the package
&lt;/h4&gt;

&lt;p&gt;Add this line to your &lt;code&gt;./project/plugins.sbt&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;addSbtPlugin&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"com.codecommit"&lt;/span&gt; % &lt;span class="s2"&gt;"sbt-github-packages"&lt;/span&gt; % &lt;span class="s2"&gt;"0.5.2"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Add library resolver and dependencies to &lt;code&gt;./build.sbt&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;Add these lines to your codebase &lt;code&gt;./build.sbt&lt;/code&gt; make the plugin to work&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;githubTokenSource := TokenSource.GitConfig("github.token")

resolvers += Resolver.githubPackages("&amp;lt;github_username&amp;gt;", "&amp;lt;github_repo_name&amp;gt;")

libraryDependencies += "&amp;lt;organization&amp;gt;" %% "&amp;lt;package_name&amp;gt;" % "&amp;lt;version&amp;gt;"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Well, there are many fields we need to match them with your package. You can &lt;strong&gt;ignore the &lt;code&gt;&amp;lt;github_repo_name&amp;gt;&lt;/code&gt; field&lt;/strong&gt;, doing so the plugin will resolve all available packages in github account &lt;code&gt;&amp;lt;github_username&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We'd like to take this package as an example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F8935612%2F93945682-c9302800-fd0d-11ea-8bd3-88cd67324317.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F8935612%2F93945682-c9302800-fd0d-11ea-8bd3-88cd67324317.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Where: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;github_username = gjuoun&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;github_repo_name = github-packages-playground&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;organization = gjuoun&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;package_name = hellopackage&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;version = 0.1.6&lt;/code&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. Compile the code
&lt;/h4&gt;

&lt;p&gt;Now you should able to compile your code with the new plugin&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sbt compile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  4. Use the package
&lt;/h4&gt;

&lt;p&gt;Suppose the package has code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="c1"&gt;// https://github.com/gjuoun/github-packages-playground/blob/master/src/main/scala/org/gjuoun/lib/calculator.scala&lt;/span&gt;
&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;org.gjuoun.lib&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Calculator&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="k"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="k"&gt;:&lt;/span&gt;&lt;span class="kt"&gt;Int&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="k"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt; &lt;span class="o"&gt;={&lt;/span&gt;
    &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Importing the package into your code is easy, just follow the package name: &lt;code&gt;org.gjuoun.lib&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.gjuoun.lib.Calculator&lt;/span&gt;


&lt;span class="c1"&gt;// use it with&lt;/span&gt;
  &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;cal&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Calculator&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
  &lt;span class="nv"&gt;Console&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="py"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;cal&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="py"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations, you've published your scala library to Github packages successfully!&lt;/p&gt;

&lt;p&gt;Demo code can be found &lt;a href="https://github.com/gjuoun/sbt-github-package-demo" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Performance aspect of Deno vs. Node</title>
      <dc:creator>Jun Guo</dc:creator>
      <pubDate>Thu, 18 Jun 2020 04:59:35 +0000</pubDate>
      <link>https://dev.to/gjuoun/perfomance-aspect-of-deno-vs-node-js-4dke</link>
      <guid>https://dev.to/gjuoun/perfomance-aspect-of-deno-vs-node-js-4dke</guid>
      <description>&lt;h3&gt;
  
  
  Talking about performance is cool
&lt;/h3&gt;

&lt;p&gt;A few days ago, I read Craig Morten's post: &lt;a href="https://dev.to/craigmorten/what-is-the-best-deno-web-framework-2k69"&gt;What Is The Best Deno Web Framework?&lt;/a&gt; It gives an overview of all the Deno frameworks and compares all the aspects of them. If you haven't read about it, I highly encourage you to do so.&lt;/p&gt;

&lt;p&gt;From Craig's post, the section &lt;strong&gt;"Performance"&lt;/strong&gt; is fascinating; In his environment, &lt;strong&gt;Deno HTTP module&lt;/strong&gt; gets almost the &lt;strong&gt;same result(even more) as Node HTTP module&lt;/strong&gt;, which amazes me, even though it's just a "Hello Deno!" benchmark test.&lt;/p&gt;

&lt;p&gt;&lt;del&gt;&lt;strong&gt;But&lt;/strong&gt;, I knew it's not true for most of the cases. Because deno HTTP module is written in Typescript. Type checking brings pleasure for development, but it costs more resources in compiler time thus has a negative effect on performance.&lt;/del&gt;&lt;br&gt;
(Thanks for Oghenovo Usiwoma and Jonathan Beaumont point out &lt;a href="https://dev.to/eunovo/comment/10hn2"&gt;in the comment&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;But I've tested it before and never got the same result as his. So I would like to see what would happen when I run tests in a more powerful machine. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Environment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU: i5-9600KF @3.7GHz&lt;/li&gt;
&lt;li&gt;RAM: 16GB DDR4 2133MHz&lt;/li&gt;
&lt;li&gt;OS: Windows 10&lt;/li&gt;
&lt;li&gt;Benchmark tool: &lt;a href="https://github.com/mcollina/autocannon"&gt;autocannon&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Benchmark Script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Hello World!" &lt;a href="https://github.com/deligenius/deligenius/blob/master/benchmark/deno.http.ts"&gt;deno server&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;"Hello World!" &lt;a href="https://github.com/deligenius/deligenius/blob/master/benchmark/node.http.js"&gt;node server&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's see the result first:&lt;/p&gt;

&lt;h4&gt;
  
  
  100 concurrent connections
&lt;/h4&gt;




&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;version&lt;/th&gt;
&lt;th&gt;AVG req/sec&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;node.http&lt;/td&gt;
&lt;td&gt;12.16.3&lt;/td&gt;
&lt;td&gt;47969.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deno.http&lt;/td&gt;
&lt;td&gt;1.0.0&lt;/td&gt;
&lt;td&gt;47376&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deno.http&lt;/td&gt;
&lt;td&gt;1.1.0&lt;/td&gt;
&lt;td&gt;46953.7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;node.http&lt;/td&gt;
&lt;td&gt;14.2.0&lt;/td&gt;
&lt;td&gt;44409&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Wow! Looks like deno beat node overall! (at least for the version 14.2.0). &lt;/p&gt;

&lt;p&gt;But wait, this benchmark is based on 100 concurrent connections by &lt;code&gt;autocannon http://localhost:3000/ -c100&lt;/code&gt;, which is too many for a small-to-medium-sized server. So I  give it another try: this time, I use &lt;code&gt;-c10&lt;/code&gt;, which keeps sending requests in 10 concurrent connections.&lt;/p&gt;

&lt;h4&gt;
  
  
  10 concurrent connections
&lt;/h4&gt;




&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;version&lt;/th&gt;
&lt;th&gt;AVG req/sec&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;node.http&lt;/td&gt;
&lt;td&gt;12.16.3&lt;/td&gt;
&lt;td&gt;49926.69&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;node.http&lt;/td&gt;
&lt;td&gt;14.2.0&lt;/td&gt;
&lt;td&gt;45345.33&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deno.http&lt;/td&gt;
&lt;td&gt;1.1.0&lt;/td&gt;
&lt;td&gt;34806.79&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deno.http&lt;/td&gt;
&lt;td&gt;1.0.0&lt;/td&gt;
&lt;td&gt;34742.37&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This time, node is absolutely the winner. There is a significant difference between the two, node has more than about 10K requests per second than deno. &lt;/p&gt;

&lt;p&gt;But, this brings a new question: &lt;/p&gt;




&lt;h3&gt;
  
  
  Why does the concurrent connection number matter?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A concurrent connection&lt;/strong&gt; is a &lt;a href="https://blog.litespeedtech.com/2013/04/26/concurrent-connections-demystified/#:~:text=A%20concurrent%20connection%20is%20a,mean%20the%20exact%20same%20time."&gt;connection happening with another connection at the same time. &lt;/a&gt;&lt;br&gt;
A user sends a request for an HTML page, then after 5ms &lt;br&gt;
 another user sends a request for a css file, which is not considered as a concurrent connection.&lt;/p&gt;




&lt;h3&gt;
  
  
  Calculate concurrent connection
&lt;/h3&gt;

&lt;p&gt;Let's say, you have 100 active users on an app. You track these users for an hour and find out each of them makes 60 clicks an hour. That's 6000 total requests on the server, and each request takes 2 seconds(which is very slow). That's 12000 seconds of active connections in 3600 seconds(an hour), which results &lt;strong&gt;3.33 concurrent connections&lt;/strong&gt; (12000/3600 = 3.33). &lt;/p&gt;

&lt;p&gt;If the server is powerful enough to allow processing each request within 1 second? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The concurrent number is even fewer, less than 1.7.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How about 1000 active users? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We get 33.3 concurrent connections&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Are 100 concurrent connections overkill?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Yes, absolutely! Except you want to build a enterprise-level application that serves 3000+ active users(in above scenario).&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Can you please tell me which one performs better? Node or Deno.
&lt;/h3&gt;

&lt;p&gt;With that said, &lt;strong&gt;the result with 10 concurrent connections is more meaningful in reality&lt;/strong&gt;, &lt;strong&gt;Node wins for the performance round.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Though deno performs better in the &lt;code&gt;-c100&lt;/code&gt; test, which means deno is doing better than node in a higher traffic network. That's great. From what I've seen, companies would prefer Java or other well known and proven languages to handle a huge amount of traffic over deno, since deno is still young and it's not production-ready yet at this point. However, everyone in deno community is making it happening 🔥.&lt;/p&gt;

&lt;p&gt;At last, I also want to mention one point. Performance is not the key of success for a dev community. Look at Python and PHP, they &lt;a href="https://dev.to/craigmorten/what-is-the-best-deno-web-framework-2k69"&gt;preform much slower&lt;/a&gt; than node and deno. What makes them popular? The ecosystem and peoples! &lt;/p&gt;




&lt;h3&gt;
  
  
  Extra topic
&lt;/h3&gt;

&lt;p&gt;Consider of &lt;a href="https://99firms.com/blog/google-search-statistics/"&gt;Google handles over 75,000 queries per second&lt;/a&gt;. &lt;br&gt;
Can your server handle this amount of request (&amp;gt;40K) per second? &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
