Comparative Performance Benchmarking of WebSocket Libraries on Node.js and Golang

Authors

  • Louis Fernando Universitas Ciputra
  • Mychael Maoeretz Engel Informatika, Universitas Ciputra, Surabaya, Indonesia

DOI:

10.33395/sinkron.v9i4.15266

Keywords:

Benchmark, Golang, Node.js, Performance Analysis, WebSocket

Abstract

The demand for responsive real-time web applications continues to grow, making the selection of backend technology and WebSocket libraries a crucial factor in determining performance. Node.js and Golang are popular platforms for real-time applications. However, the WebSocket library within them offers a trade-off between features and efficiency, the impact of which has not been comprehensively measured. This research aims to fill this gap by conducting a quantitative performance analysis to compare the efficiency and scalability of four WebSocket libraries: ws and socket.io on Node.js, and gorilla/websocket and coder/websocket on Golang. This research uses a benchmarking experimental method with client load simulations that gradually increase from 100 to 1000 concurrent clients. The experiment was conducted through two scenarios, namely the Echo Test and Broadcast Test. In the Echo Test, the performance metrics measured were Connection Time, Round Trip Time (RTT), and Throughput. Meanwhile, in the Broadcast Test, the performance metric measured was Broadcast Latency. The results from the Echo Test show a significant performance disparity. At a peak load of 1000 clients, socket.io achieved a throughput of only 27,152 messages/second, whereas the lightweight libraries (ws, gorilla/websocket, and coder/websocket) all achieved over 44,000 messages/second. In the Broadcast Test with a high load, the latency difference between the four libraries became insignificant. Therefore, for applications prioritizing raw performance in point-to-point communication, certain WebSocket libraries such as ws, gorilla/websocket, and coder/websocket are more suitable for future development.

GS Cited Analysis

Downloads

Download data is not yet available.

References

Abdelfattah, A. S., Abdelkader, T., & EI-Horbaty, E.-S. M. (2020). RAMWS: Reliable approach using middleware and WebSockets in mobile cloud computing. Ain Shams Engineering Journal, 11(4), 1083–1092. doi:10.1016/j.asej.2020.04.002

Alexeev, V. A., Domashnev, P. V., Lavrukhina, T. V., & Nazarkin, O. A. (2019). The Design Principles of Intelligent Load Balancing for Scalable WebSocket Services Used with Grid Computing. Procedia Computer Science, 150, 61–68. doi:10.1016/j.procs.2019.02.014

Ariffin, N. I., Hamdan, Muhd. A. S., & Kamarulzaman, S. F. (2023). Internet of Things Intercommunication Using SocketIO and WebSocket with WebRTC in Local Area Network as Emergency Communication Devices. In 2023 IEEE 8th International Conference On Software Engineering and Computer Systems (ICSECS) (pp. 268–273). IEEE. doi:10.1109/ICSECS58457.2023.10256297

Bisták, P. (2020). Remote Control Laboratory for Three-Tank Hydraulic System Using Matlab, Websockets and JavaScript. IFAC-PapersOnLine, 53(2), 17240–17245. doi:10.1016/j.ifacol.2020.12.1766

Bistak, P., Huba, M., Drahos, P., Belai, I., & Vrancic, D. (2024). Magnetic Levitation Remote Control Laboratory Based on Matlab and Websockets. IFAC-PapersOnLine, 58(9), 235–240. doi:10.1016/j.ifacol.2024.07.402

Chodorek, A., & Chodorek, R. R. (2025). Web Real-Time Communications-Based Unmanned-Aerial-Vehicle-Borne Internet of Things and Stringent Time Sensitivity: A Case Study. Sensors, 25(2), 524. doi:10.3390/s25020524

Friendly, Padly Sembiring, A., Faza, S., & Luckyhasnita, A. (2022). Speed Comparison OF Websocket And HTTP In IOT Data Communication. INFOKUM, 10(5), 46–51. Retrieved from http://infor.seaninstitute.org/index.php/infokum/index

Gote, A. (2024). REAL-TIME INTERACTIVITY IN HYBRID APPLICATIONS WITH WEB SOCKETS. International Research Journal of Modernization in Engineering Technology and Science, 6(1), 2459–2463. doi:10.56726/IRJMETS48494

Gupta, K., & Sharma, T. (2021). Changing Trends in Computer Architecture : A Comprehensive Analysis of ARM and x86 Processors. International Journal of Scientific Research in Computer Science, Engineering and Information Technology, 7(3), 619–631. doi:10.32628/CSEIT2173188

Hansson, J. (2020). Performance study of JavaScript WebSocket frameworks. Digitala Vetenskapliga Arkivet. Retrieved from https://liu.diva-portal.org/smash/record.jsf?pid=diva2%3A1459815&dswid=22

Huang, X. (2020). Research and Application of Node.js Core Technology. In 2020 International Conference on Intelligent Computing and Human-Computer Interaction (ICHCI) (pp. 1–4). IEEE. doi:10.1109/ICHCI51889.2020.00008

Kirilov, N. (2024). Comparison of WebSocket and Hypertext Transfer Protocol for Transfer of Electronic Health Records (pp. 124–128). IOS Press. doi:10.3233/SHTI240023

Luo, J., Zhou, B., Zheng, Y., & Pan, W. (2024). Research on high performance web service construction method based on JavaScript asynchronous programming technique. Applied Mathematics and Nonlinear Sciences, 9(1), 1–16. doi:10.2478/amns-2024-2811

Mitrovic, N., Eordevic, M., Veljkovic, S., & Dankovic, D. (2021). Implementation of WebSockets in ESP32 based IoT Systems. In 2021 15th International Conference on Advanced Technologies, Systems and Services in Telecommunications (TELSIKS) (pp. 261–264). IEEE. doi:10.1109/TELSIKS52058.2021.9606244

Murley, P., Ma, Z., Mason, J., Bailey, M., & Kharraz, A. (2021). WebSocket Adoption and the Landscape of the Real-Time Web. In Proceedings of the Web Conference 2021 (pp. 1192–1203). New York, NY, USA: ACM. doi:10.1145/3442381.3450063

Paris, I. L. B. M., Habaebi, M. H., & Zyoud, A. M. (2023). Implementation of SSL/TLS Security with MQTT Protocol in IoT Environment. Wireless Personal Communications, 132(1), 163–182. doi:10.1007/s11277-023-10605-y

Puranik, D. G., Feiock, D. C., & Hill, J. H. (2013). Real-Time Monitoring using AJAX and WebSockets. In 2013 20th IEEE International Conference and Workshops on Engineering of Computer Based Systems (ECBS) (pp. 110–118). IEEE. doi:10.1109/ECBS.2013.10

Ramu, V. B. (2023). Performance Testing for Hybrid Cloud Environments. The Review of Contemporary Scientific and Academic Studies, 3(7). doi:10.55454/rcsas.3.07.2023.005

Sekar, R. (2025). Real-Time Data Streaming: Advancing Technologies, Future Trends, and Industry Applications. International Journal of Scientific Research in Computer Science, Engineering and Information Technology, 11(2), 513–521. doi:10.32628/CSEIT25112383

Soewito, B., Christian, Gunawan, F. E., Diana, & Kusuma, I. G. P. (2019). Websocket to Support Real Time Smart Home Applications. Procedia Computer Science, 157, 560–566. doi:10.1016/j.procs.2019.09.014

Suwarno, & Putri Yulandi, A. (2023). Analisis Performa Backend Framework: Studi Komparasi Framework Golang dan Node.js. Jurnal Riset Sistem Informasi Dan Teknik Informatika, 8(1), 155–168. Retrieved from https://www.tunasbangsa.ac.id/ejurnal/index.php/jurasik/article/view/551

Tomasetti, M. (2021). An Analysis of the Performance of Websockets in Various Programming Languages and Libraries. Retrieved from http://dx.doi.org/10.2139/ssrn.3778525

Downloads


Crossmark Updates

How to Cite

Fernando, L., & Engel, M. M. . (2025). Comparative Performance Benchmarking of WebSocket Libraries on Node.js and Golang. Sinkron : Jurnal Dan Penelitian Teknik Informatika, 9(4), 2051-2060. https://doi.org/10.33395/sinkron.v9i4.15266