Code Monkey home page Code Monkey logo

daalvand / speed-test Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 613 KB

The "Speed Test" project is a benchmarking tool aimed at comparing the request-per-second (RPS) performance of various programming languages/frameworks using a simple "Hello World" implementation.

Go 0.10% JavaScript 0.93% PHP 85.21% Blade 7.48% Shell 1.93% Batchfile 0.27% Awk 0.32% CSS 1.34% Python 0.68% HTML 0.14% Dockerfile 1.60%
benchmark codeigniter docker fastapi flask golang laravel laravel-octane nodejs performance

speed-test's Introduction

Speed Test

The "Speed Test" project is designed to benchmark the performance of various programming languages/frameworks by comparing their request-per-second (RPS) capabilities for a simple "Hello World" implementation. This README provides instructions on how to run the tests, generate results, and visualize the data.

Motivation

The main motivation behind this project was to compare the RPS (request-per-second) performance of different frameworks and languages, including Go, pure PHP, Swoole-PHP, ReactPHP, and Node.js. The goal was to gain insights into the performance characteristics of these technologies and identify potential strengths and weaknesses in handling concurrent requests.

Default Test Configuration

Tool Concurrent Connections (-c) Test Duration/Requests (-t or -d)
ab 100 10 seconds
wrk 100 10 seconds
hey 100 10,000 requests

Running the Tests

To run the tests and collect data, follow these steps:

  1. Start Services: Execute the following commands in your terminal to initiate the speed tests for different programming languages/frameworks:
./scripts/test-ab.sh
./scripts/test-hey.sh
./scripts/test-wrk.sh
  1. Review Results: After running the tests, navigate to the export folder, where you will find the results categorized by test type in the subfolders ab, wrk, and hey. These subfolders contain text files containing throughput results of all tested languages/frameworks.

  2. Generate CSV Files: Additionally, the export folder will contain CSV files that provide detailed information about the request-per-second (RPS) performance of each programming language/framework. These CSV files are useful for in-depth analysis and further comparison.

Please note that running these services in a Docker environment ensures consistent and isolated test environments.

Visualizing Results

To gain better insights into the collected data, you can generate bar chart images from the CSV files. Follow these steps:

  1. Create Bar Chart Images: Execute the following command in the terminal:
./scripts/plt.sh
  1. View Bar Chart Images: The script will convert the CSV files in the export folder into bar chart images in PNG format. These images will be stored in the export folder, making it convenient to visualize the results.

Unexpected Observations

During the tests, I made an interesting observation. The RPS results for Node.js were unexpectedly low compared to my initial expectations. I had anticipated that Node.js would achieve around 20,000 RPS, but the actual results did not meet this expectation.

Recommendations

For more accurate results and to perform tests on a larger scale, it is recommended to execute the commands on a more powerful server. This would ensure that the performance of each programming language/framework is assessed under optimal conditions, reducing the influence of local machine specifications on the results.

Result Summary

Here are two sample images displaying the results of Apache Bench and Wrk tests:

Apache Bench:

bar-graph.png

Wrk Result:

wrk-result.png

Hey Result:

wrk-result.png

Conclusion

By following these instructions and considering the unexpected observations, you can conduct comprehensive performance tests for various programming languages/frameworks. The project provides valuable insights into the RPS capabilities of different implementations, allowing you to make informed decisions based on performance benchmarks. If you encounter any issues or have suggestions for improvement, please feel free to contribute to the project. Happy testing!

speed-test's People

Contributors

daalvand avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.