github.com/gofiber/fiber/v2@v2.47.0/docs/extra/benchmarks.md (about)

     1  ---
     2  id: benchmarks
     3  title: 📊 Benchmarks
     4  description: >-
     5    These benchmarks aim to compare the performance of Fiber and other web
     6    frameworks.
     7  sidebar_position: 2
     8  ---
     9  
    10  ## TechEmpower
    11  
    12  [TechEmpower](https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=composite) provides a performance comparison of many web application frameworks executing fundamental tasks such as JSON serialization, database access, and server-side template composition.
    13  
    14  Each framework is operating in a realistic production configuration. Results are captured on cloud instances and on physical hardware. The test implementations are largely community-contributed and all source is available at the [GitHub repository](https://github.com/TechEmpower/FrameworkBenchmarks).
    15  
    16  * Fiber `v1.10.0`
    17  * 28 HT Cores Intel\(R\) Xeon\(R\) Gold 5120 CPU @ 2.20GHz
    18  * 32GB RAM
    19  * Ubuntu 18.04.3 4.15.0-88-generic
    20  * Dedicated Cisco 10-Gbit Ethernet switch.
    21  
    22  ### Plaintext
    23  
    24  The Plaintext test is an exercise of the request-routing fundamentals only, designed to demonstrate the capacity of high-performance platforms in particular. Requests will be sent using HTTP pipelining. The response payload is still small, meaning good performance is still necessary in order to saturate the gigabit Ethernet of the test environment.
    25  
    26  See [Plaintext requirements](https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#single-database-query)
    27  
    28  **Fiber** - **6,162,556** responses per second with an average latency of **2.0** ms.  
    29  **Express** - **367,069** responses per second with an average latency of **354.1** ms.
    30  
    31  ![](/img/plaintext.png)
    32  
    33  ![Fiber vs Express](/img/plaintext_express.png)
    34  
    35  ### Data Updates
    36  
    37  **Fiber** handled **11,846** responses per second with an average latency of **42.8** ms.  
    38  **Express** handled **2,066** responses per second with an average latency of **390.44** ms.
    39  
    40  ![](/img/data_updates.png)
    41  
    42  ![Fiber vs Express](/img/data_updates_express.png)
    43  
    44  ### Multiple Queries
    45  
    46  **Fiber** handled **19,664** responses per second with an average latency of **25.7** ms.  
    47  **Express** handled **4,302** responses per second with an average latency of **117.2** ms.
    48  
    49  ![](/img/multiple_queries.png)
    50  
    51  ![Fiber vs Express](/img/multiple_queries_express.png)
    52  
    53  ### Single Query
    54  
    55  **Fiber** handled **368,647** responses per second with an average latency of **0.7** ms.  
    56  **Express** handled **57,880** responses per second with an average latency of **4.4** ms.
    57  
    58  ![](/img/single_query.png)
    59  
    60  ![Fiber vs Express](/img/single_query_express.png)
    61  
    62  ### JSON Serialization
    63  
    64  **Fiber** handled **1,146,667** responses per second with an average latency of **0.4** ms.  
    65  **Express** handled **244,847** responses per second with an average latency of **1.1** ms.
    66  
    67  ![](/img/json.png)
    68  
    69  ![Fiber vs Express](/img/json_express.png)
    70  
    71  ## Go web framework benchmark
    72  
    73  🔗 [https://github.com/smallnest/go-web-framework-benchmark](https://github.com/smallnest/go-web-framework-benchmark)
    74  
    75  * **CPU** Intel\(R\) Xeon\(R\) Gold 6140 CPU @ 2.30GHz
    76  * **MEM** 4GB
    77  * **GO** go1.13.6 linux/amd64
    78  * **OS** Linux
    79  
    80  The first test case is to mock **0 ms**, **10 ms**, **100 ms**, **500 ms** processing time in handlers.
    81  
    82  ![](/img/benchmark.png)
    83  
    84  The concurrency clients are **5000**.
    85  
    86  ![](/img/benchmark_latency.png)
    87  
    88  Latency is the time of real processing time by web servers. _The smaller is the better._
    89  
    90  ![](/img/benchmark_alloc.png)
    91  
    92  Allocs is the heap allocations by web servers when test is running. The unit is MB. _The smaller is the better._
    93  
    94  If we enable **http pipelining**, test result as below:
    95  
    96  ![](/img/benchmark-pipeline.png)
    97  
    98  Concurrency test in **30 ms** processing time, the test result for **100**, **1000**, **5000** clients is:
    99  
   100  ![](/img/concurrency.png)
   101  
   102  ![](/img/concurrency_latency.png)
   103  
   104  ![](/img/concurrency_alloc.png)
   105  
   106  If we enable **http pipelining**, test result as below:
   107  
   108  ![](/img/concurrency-pipeline.png)
   109  
   110  Dependency graph for `v1.9.0`
   111  
   112  ![](/img/graph.svg)