{"id":482732,"date":"2026-06-08T04:38:54","date_gmt":"2026-06-08T04:38:54","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=482732"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=482732","title":{"rendered":"WebSocket \u043d\u0430 C++11 \u0438 Rust: \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0434\u0432\u0443\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>WebSocket \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438: \u0447\u0430\u0442\u044b, \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0435 \u043a\u043e\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u044b, IoT. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u044b\u0431\u043e\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0440\u0435\u0434\u043a\u043e \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u00ab\u043a\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0430\u0440\u0441\u0438\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0444\u0440\u0435\u0439\u043c\u0430\u00bb. \u0412\u0430\u0436\u043d\u0435\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 TLS, \u0441\u0436\u0430\u0442\u0438\u044f per-message-deflate, \u043c\u043e\u0434\u0435\u043b\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438, \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u0412 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 <a href=\"https:\/\/github.com\/gvtret\/wscpp\" rel=\"noopener noreferrer nofollow\">wscpp<\/a> \u043b\u0435\u0436\u0430\u0442 \u0434\u0432\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435, \u043d\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430:<\/p>\n<ul>\n<li>\n<p><strong>wscpp<\/strong> \u2014 C++11, \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440, \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f MIT;<\/p>\n<\/li>\n<li>\n<p><strong>ws-rs<\/strong> \u2014 Rust-\u043a\u043e\u043c\u043f\u0430\u043d\u044c\u043e\u043d \u0441 \u0442\u043e\u0439 \u0436\u0435 \u043f\u043e\u0441\u043b\u043e\u0439\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439 \u0438 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 RFC 6455 \u00a75.7.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p><strong>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440:<\/strong> \u043e\u0431\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AI-\u0430\u0433\u0435\u043d\u0442\u043e\u0432; \u043b\u044e\u0434\u0438 \u043a\u0443\u0440\u0438\u0440\u0443\u044e\u0442 \u0442\u0435\u0441\u0442\u044b, CI \u0438 \u0440\u0435\u043b\u0438\u0437\u044b. \u041d\u0438\u0436\u0435 \u2014 \u043d\u0435 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u044b\u0439 \u043e\u0431\u0437\u043e\u0440, \u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0446\u0438\u0444\u0440\u0430\u043c\u0438.<\/p>\n<\/blockquote>\n<blockquote>\n<p><strong>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440:<\/strong> \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u2014 7 \u0438\u044e\u043d\u044f 2026; \u0440\u0430\u0437\u043c\u0435\u0440\u044b ELF \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u044b 8 \u0438\u044e\u043d\u044f 2026. \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430: Linux\/WSL2 (GCC 15), Release; \u0432 LAN \u2014 Debian 13 VM, RTT ~0,5\u20130,7 \u043c\u0441. \u0412 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 TLS \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f (\u043d\u043e \u043a\u043e\u0434 TLS\/deflate \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0432 \u0441\u0431\u043e\u0440\u043a\u0443). \u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u2014 \u043e\u0434\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435.<\/p>\n<\/blockquote>\n<hr\/>\n<h3>\u041c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f<\/h3>\n<h4>\u041f\u043e\u0440\u043e\u0433 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 RFC<\/h4>\n<p>\u0411\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430\u0431\u043e\u0440\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">RFC<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0421\u0442\u0430\u0442\u0443\u0441 wscpp \/ ws-rs<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc6455\" rel=\"noopener noreferrer nofollow\">RFC 6455<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0424\u0440\u0435\u0439\u043c\u044b, \u0440\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435, \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435, ping\/pong, \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f, UTF-8 \u00a78.1<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc2818\" rel=\"noopener noreferrer nofollow\">RFC 2818<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>wss:\/\/<\/code>, SNI<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc7692\" rel=\"noopener noreferrer nofollow\">RFC 7692<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0436\u0430\u0442\u0438\u0435 per-message-deflate<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0442\u043e \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0417\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u044d\u0445\u043e-\u043e\u0442\u0432\u0435\u0442\u0430 (p50\/p99)<\/p>\n<\/td>\n<td>\n<p align=\"left\">100 \u0446\u0438\u043a\u043b\u043e\u0432 \u00ab\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u2014 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u00bb \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c ping-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u043d\u0430 localhost \u0438 \u0432 LAN<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c 64 KiB<\/p>\n<\/td>\n<td>\n<p align=\"left\">100 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u0438 \u0441\u0431\u043e\u0440\u043a\u0430 \u0444\u0440\u0435\u0439\u043c\u043e\u0432<\/p>\n<\/td>\n<td>\n<p align=\"left\">1 MiB, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u043a\u0440\u043e\u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a (\u0442\u043e\u043b\u044c\u043a\u043e CPU)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0417\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0422\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a (easywsclient)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f:<\/strong> \u043e\u0434\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0433\u043e\u043d; \u0432 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u043d\u0435\u0442 TLS; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 LAN \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u2014 \u043d\u0430 localhost \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0442 \u043c\u0438\u043a\u0440\u043e\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0430\u0440\u0441\u0435\u0440\u0430, \u0432 LAN \u2014 \u0441\u0435\u0442\u0435\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0430 \u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u041e\u0421.<\/p>\n<h4>\u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430: \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c<\/h4>\n<p>\u0412\u043e \u0432\u0441\u0435\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 ELF-\u0444\u0430\u0439\u043b\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 (<code>stat -c%s<\/code> \u043d\u0430 <code>bench_*_roundtrip<\/code>), Release-\u0441\u0431\u043e\u0440\u043a\u0430. \u042d\u0442\u043e <strong>\u043d\u0435<\/strong> \u00ab\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439\u00bb \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442 \u0438 <strong>\u043d\u0435<\/strong> \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0421\u0442\u0435\u043a<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0442\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 ELF<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0442\u043e \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0440\u0443\u0436\u0438 (\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 <code>.so<\/code>)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>wscpp<\/strong> (C++)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (<code>libwscpp.a<\/code> \u043b\u0438\u043d\u043a\u0443\u0435\u0442\u0441\u044f \u0432 exe)<\/p>\n<\/td>\n<td>\n<p align=\"left\">OpenSSL (<code>libssl<\/code>, <code>libcrypto<\/code>), zlib, <code>libstdc++<\/code>, <code>libc<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>ws-rs<\/strong> (Rust)<\/p>\n<\/td>\n<td>\n<p align=\"left\">rustls, ring, flate2, tokio (\u0435\u0441\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c <code>libc<\/code>, <code>libgcc_s<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>libwebsockets<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0442\u043e\u043d\u043a\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>libwebsockets.so<\/code> \u0438 \u0435\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0434\u043b\u044f \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f:<\/p>\n<ul>\n<li>\n<p>C++ &#8212; \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a <strong>\u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043c\u0435\u043d\u044c\u0448\u0435<\/strong>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f (OpenSSL ~7 \u041c\u0411 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 <code>.so<\/code>) \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 ELF. \u041d\u0430 \u00ab\u0433\u043e\u043b\u043e\u0439\u00bb \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0431\u0435\u0437 OpenSSL \u044d\u0442\u0438 <code>.so<\/code> \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>Rust &#8212; \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a <strong>\u0431\u043e\u043b\u044c\u0448\u0435, \u043a\u0430\u043a \u0444\u0430\u0439\u043b<\/strong>, \u043d\u043e <strong>\u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0435\u0435<\/strong>: TLS \u0438 deflate \u0432\u0448\u0438\u0442\u044b \u0432 ELF.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u044f\u043c\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u00ab286 \u041a\u0411 C++ vs 1,9 \u041c\u0411 Rust\u00bb \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0444\u0430\u0439\u043b\u0430 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e<\/strong> \u0431\u0435\u0437 \u044d\u0442\u043e\u0439 \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u0438. \u0414\u043b\u044f embedded \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e ELF, \u043d\u043e \u0438 \u0442\u043e, \u0435\u0441\u0442\u044c \u043b\u0438 OpenSSL \u0432 \u043e\u0431\u0440\u0430\u0437\u0435.<\/p>\n<\/li>\n<li>\n<p>C++ &#8212; \u0437\u0430\u043c\u0435\u0440\u044b: <code>WSCPP_ENABLE_LOGGING=OFF<\/code> (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u0438 \u0434\u0430\u0435\u0442 ~650 \u041a\u0411 \u0432\u043c\u0435\u0441\u0442\u043e ~286 \u041a\u0411). Rust-\u0437\u0430\u043c\u0435\u0440\u044b: <code>[profile.release]<\/code> \u0441 <code>lto = \"fat\"<\/code>, <code>strip = true<\/code> \u0432 <code>rust\/Cargo.toml<\/code>.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h3>\u0427\u0430\u0441\u0442\u044c 1. \u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 WebSocket \u0434\u043b\u044f C++11<\/h3>\n<h4>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u043e\u0442\u0431\u043e\u0440\u0430<\/h4>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u043e\u043f\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 <strong>C++11<\/strong> (\u0438\u043b\u0438 C API, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u0437 C++11 \u0431\u0435\u0437 \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430). \u0420\u0435\u0448\u0435\u043d\u0438\u044f, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 C++17 \u0438 \u0432\u044b\u0448\u0435 (uWebSockets, Poco Net 1.13+, seasocks), \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u044b.<\/p>\n<h4>\u041f\u0435\u0440\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c: \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">C++11<\/p>\n<\/th>\n<th>\n<p align=\"left\">TLS<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">websocketpp<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">ASIO<\/p>\n<\/td>\n<td>\n<p align=\"left\">ASIO, OpenSSL<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Boost.Beast<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">Boost.Asio<\/p>\n<\/td>\n<td>\n<p align=\"left\">Boost, OpenSSL<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">IXWebSocket<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u0442\u043e\u043a\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">zlib, OpenSSL\/MbedTLS<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Simple-WebSocket-Server<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">ASIO<\/p>\n<\/td>\n<td>\n<p align=\"left\">ASIO, OpenSSL<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>wscpp<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">ASIO \u0438\u043b\u0438 POSIX<\/p>\n<\/td>\n<td>\n<p align=\"left\">ASIO\u2020 \u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e OpenSSL<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u2020 ASIO 1.20 \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 FetchContent \u043f\u0440\u0438 <code>WSCPP_USE_ASIO=ON<\/code>.<\/p>\n<h4>\u0412\u0442\u043e\u0440\u043e\u0439 \u0438 \u0442\u0440\u0435\u0442\u0438\u0439 \u0443\u0440\u043e\u0432\u043d\u0438: \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u044b \u0438 C-\u0441\u0442\u0435\u043a\u0438<\/h4>\n<ul>\n<li>\n<p><strong>easywsclient<\/strong> (~600 \u0441\u0442\u0440\u043e\u043a) \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0438\u0435\u043d\u0442, \u0431\u0435\u0437 TLS;<\/p>\n<\/li>\n<li>\n<p><strong>libwebsockets<\/strong> \u2014 \u0437\u0440\u0435\u043b\u044b\u0439 production-\u0441\u0442\u0435\u043a \u043d\u0430 C, \u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 localhost (\u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u044d\u0445\u043e \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430)<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">p50<\/p>\n<\/th>\n<th>\n<p align=\"left\">p99<\/p>\n<\/th>\n<th>\n<p align=\"left\">64 KiB<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>wscpp (linux POSIX)<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">0,25 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,36 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">92 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>286 \u041a\u0411<\/strong>\u2020<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>wscpp (ASIO)<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">0,25 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,32 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">82 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">383 \u041a\u0411\u2020<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">websocketpp 0.8.2<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,31 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,59 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2014<\/p>\n<\/td>\n<td>\n<p align=\"left\">687 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">IXWebSocket 11.4.6<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,28 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,68 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">62 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">473 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">libwebsockets 4.3.5<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,26 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,40 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2014<\/p>\n<\/td>\n<td>\n<p align=\"left\">126 \u041a\u0411*<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Boost.Beast 1.88<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,25 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,32 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">68 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">667 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Simple-WebSocket-Server<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,28 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,46 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2014<\/p>\n<\/td>\n<td>\n<p align=\"left\">675 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>* libwebsockets \u043b\u0438\u043d\u043a\u0443\u0435\u0442\u0441\u044f \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 <code>.so<\/code> \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 ELF \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0430\u043c\u0438, \u0433\u0434\u0435 OpenSSL \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u2020 \u0440\u0430\u0437\u043c\u0435\u0440 ELF; OpenSSL \u0438 zlib \u2014 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 <code>.so<\/code> (\u0441\u043c. <a href=\"#%D1%80%D0%B0%D0%B7%D0%BC%D0%B5%D1%80-%D0%B1%D0%B8%D0%BD%D0%B0%D1%80%D0%BD%D0%B8%D0%BA%D0%B0-%D1%87%D1%82%D0%BE-%D0%B8%D0%BC%D0%B5%D0%BD%D0%BD%D0%BE-%D1%81%D1%80%D0%B0%D0%B2%D0%BD%D0%B8%D0%B2%D0%B0%D0%B5%D0%BC\" rel=\"noopener noreferrer nofollow\">\u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044e<\/a>).<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 (\u0434\u0432\u0435 \u043c\u0430\u0448\u0438\u043d\u044b, plain ws:\/\/)<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">p50<\/p>\n<\/th>\n<th>\n<p align=\"left\">p99<\/p>\n<\/th>\n<th>\n<p align=\"left\">64 KiB<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">wscpp (linux)<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,34 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">1,24 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">27 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">wscpp (ASIO)<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,40 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,77 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">28 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">websocketpp<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,32 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">2,01 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2014<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">IXWebSocket<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,42 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,85 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">31 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">libwebsockets<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,33 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">3,55 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2014<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Beast<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,32 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,86 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">29 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<p><strong>\u0412\u044b\u0432\u043e\u0434 \u043f\u043e C++:<\/strong> \u043f\u043e \u043c\u0435\u0434\u0438\u0430\u043d\u0435 (p50) \u043d\u0430 localhost \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 ~0,25\u20130,31 \u043c\u0441. \u0420\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0437\u0430\u043c\u0435\u0442\u043d\u0435\u0435 \u0432 \u0445\u0432\u043e\u0441\u0442\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (p99): websocketpp \u0438 libwebsockets \u043d\u0430 LAN \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041e\u0441\u043e\u0431\u043d\u044f\u043a\u043e\u043c \u0441\u0442\u043e\u044f\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 ELF \u0438 \u043c\u043e\u0434\u0435\u043b\u044c API. \u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442 wscpp \u043d\u0430 POSIX-\u0441\u043e\u043a\u0435\u0442\u0430\u0445 \u0434\u0430\u0435\u0442 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 <strong>\u0444\u0430\u0439\u043b<\/strong> \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 C++ &#8212; \u0441\u0442\u0435\u043a\u043e\u0432 \u2014 \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e OpenSSL \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<h4>wscpp: \u0434\u0432\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430<\/h4>\n<pre><code class=\"bash\"># \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 ELF \u2014 POSIX, OpenSSL \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438cmake -B build-linux -DWSCPP_BUILD_BENCHMARKS=ON \\  -DWSCPP_USE_ASIO=OFF -DWSCPP_ENABLE_LOGGING=OFF# \u041a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 ASIOcmake -B build-asio -DWSCPP_BUILD_BENCHMARKS=ON \\  -DWSCPP_USE_ASIO=ON -DWSCPP_ENABLE_LOGGING=OFF<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442<\/p>\n<\/th>\n<th>\n<p align=\"left\">p50<\/p>\n<\/th>\n<th>\n<p align=\"left\">p99<\/p>\n<\/th>\n<th>\n<p align=\"left\">64 KiB<\/p>\n<\/th>\n<th>\n<p align=\"left\">ELF (\u041a\u0438\u0411)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">linux POSIX<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,25 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,36 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">92 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">286 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">ASIO<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,25 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,32 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">82 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">383 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041c\u0438\u043a\u0440\u043e\u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0441\u043b\u043e\u044f \u0444\u0440\u0435\u0439\u043c\u043e\u0432 (\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430):<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0421\u0431\u043e\u0440\u043a\u0430 \u0444\u0440\u0435\u0439\u043c\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">~15 \u0413\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u0444\u0440\u0435\u0439\u043c\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">~22 \u0413\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">XOR-\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">~70 \u0413\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<hr\/>\n<h3>\u0427\u0430\u0441\u0442\u044c 2. \u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 WebSocket \u0434\u043b\u044f Rust<\/h3>\n<h4>\u041f\u0435\u0440\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c: \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 tokio<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0421\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/th>\n<th>\n<p align=\"left\">TLS<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">tokio-tungstenite<\/p>\n<\/td>\n<td>\n<p align=\"left\">tokio<\/p>\n<\/td>\n<td>\n<p align=\"left\">rustls\/native-tls<\/p>\n<\/td>\n<td>\n<p align=\"left\">MIT<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">fastwebsockets<\/p>\n<\/td>\n<td>\n<p align=\"left\">tokio \/ \u0440\u0443\u0447\u043d\u043e\u0439 \u0440\u0435\u0436\u0438\u043c<\/p>\n<\/td>\n<td>\n<p align=\"left\">rustls<\/p>\n<\/td>\n<td>\n<p align=\"left\">Apache-2.0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">tokio-websockets<\/p>\n<\/td>\n<td>\n<p align=\"left\">tokio<\/p>\n<\/td>\n<td>\n<p align=\"left\">rustls<\/p>\n<\/td>\n<td>\n<p align=\"left\">MIT<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>ws-rs<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">tokio + \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0436\u0438\u043c<\/p>\n<\/td>\n<td>\n<p align=\"left\">rustls<\/p>\n<\/td>\n<td>\n<p align=\"left\">MIT<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 localhost<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">p50<\/p>\n<\/th>\n<th>\n<p align=\"left\">p99<\/p>\n<\/th>\n<th>\n<p align=\"left\">64 KiB<\/p>\n<\/th>\n<th>\n<p align=\"left\">ELF (\u041a\u0438\u0411)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">ws-rs (tokio)<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,26 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,37 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">78 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">2311 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">ws-rs (\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439)<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,25 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,31 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">84 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">1895 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">tokio-tungstenite<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,30 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,41 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">76 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">856 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">fastwebsockets<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,29 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,55 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">83 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">1037 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">tokio-websockets<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,31 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,44 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">85 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">779 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">p50<\/p>\n<\/th>\n<th>\n<p align=\"left\">p99<\/p>\n<\/th>\n<th>\n<p align=\"left\">64 KiB<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">ws-rs (tokio)<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,35 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,51 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">30 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">ws-rs (\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439)<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,40 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,51 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">30 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">tokio-tungstenite<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,37 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,67 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">30 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">fastwebsockets<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,36 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,60 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">30 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">tokio-websockets<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,38 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,67 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">30 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<p><strong>\u0412\u044b\u0432\u043e\u0434 \u043f\u043e Rust:<\/strong> tokio-tungstenite \u2014 \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b. fastwebsockets \u0438 tokio-websockets \u043a\u043e\u043d\u043a\u0443\u0440\u0438\u0440\u0443\u044e\u0442 \u043f\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 localhost. \u041f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 ELF ws-rs \u0442\u044f\u0436\u0435\u043b\u0435\u0435 wscpp: \u0432 Rust-\u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0432\u0448\u0438\u0442\u044b rustls, ring \u0438 flate2, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0443 C++ OpenSSL \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432 <code>.so<\/code>. \u0411\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 <code>bench_blocking_roundtrip<\/code> (~1,9 \u041c\u0411) \u043c\u0435\u043d\u044c\u0448\u0435 tokio-\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 (~2,3 \u041c\u0411), \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043a\u0440\u0443\u043f\u043d\u0435\u0435 C++ ELF (~286 \u041a\u0411) \u2014 \u0437\u0430\u0442\u043e \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u0435\u0435 \u043f\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c.<\/p>\n<p>\u0417\u0430\u043c\u0435\u0440\u044b Rust \u2014 \u0447\u0435\u0440\u0435\u0437 <code>cargo build --release -p ws-rs-benches --bins<\/code> (\u0432\u0441\u0435 default-features ws-rs). \u0414\u043b\u044f <strong>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/strong> \u0431\u0435\u0437 tokio \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438:<\/p>\n<pre><code class=\"bash\">cargo build -p ws-rs --release --no-default-features \\  --features \"std-blocking,deflate,blocking-tls\"<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e <code>bench_blocking_roundtrip<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043b\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 C++ &#8212; \u0441\u0442\u0435\u043a\u043e\u043c.<\/p>\n<p>\u0412 LAN \u0432\u0441\u0435 \u0447\u0435\u0442\u044b\u0440\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043a ~30 \u041c\u0411\/\u0441 \u2014 \u0443\u043f\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0435\u0442\u044c, \u0430 \u043d\u0435 \u0432 \u043f\u0430\u0440\u0441\u0435\u0440.<\/p>\n<hr\/>\n<h3>\u0427\u0430\u0441\u0442\u044c 3. C++ \u0438 Rust: \u043e\u0434\u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430, \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b<\/h3>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 wscpp \u2014 \u0440\u0435\u0434\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 <strong>\u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0434\u0432\u0430\u0436\u0434\u044b<\/strong> \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u0437\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0441\u0442\u0435\u043d\u0434\u0430\u043c\u0438.<\/p>\n<h4>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0421\u043b\u043e\u0439<\/p>\n<\/th>\n<th>\n<p align=\"left\">wscpp (C++)<\/p>\n<\/th>\n<th>\n<p align=\"left\">ws-rs (Rust)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0424\u0440\u0435\u0439\u043c\u044b<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>frame::parser<\/code> \/ <code>builder<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>frame::Parser<\/code> \/ <code>FrameBuilder<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0420\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>handshake<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>handshake<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u0442\u043e\u043a + \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442<\/p>\n<\/td>\n<td>\n<p align=\"left\">tokio <code>TcpStream<\/code> \u0438\u043b\u0438 <code>std::net<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 API<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>client<\/code>, <code>server<\/code> (\u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b)<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>Client<\/code>, <code>Server<\/code> (\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043e\u043f\u0440\u043e\u0441)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041e\u0448\u0438\u0431\u043a\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>std::error_code<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>Result&lt;T, Error&gt;<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">TLS<\/p>\n<\/td>\n<td>\n<p align=\"left\">OpenSSL<\/p>\n<\/td>\n<td>\n<p align=\"left\">rustls<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u041f\u0430\u0440\u0438\u0442\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">wscpp<\/p>\n<\/th>\n<th>\n<p align=\"left\">ws-rs<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">RFC 6455<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">wss:\/\/<\/p>\n<\/td>\n<td>\n<p align=\"left\">OpenSSL<\/p>\n<\/td>\n<td>\n<p align=\"left\">rustls<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">per-message-deflate<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430 (v1.1.0)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0434\u0430 (v0.3.0+)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0414\u0432\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">ASIO \/ linux POSIX<\/p>\n<\/td>\n<td>\n<p align=\"left\">tokio \/ std-blocking<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0412\u0435\u043a\u0442\u043e\u0440\u044b \u00a75.7<\/p>\n<\/td>\n<td>\n<p align=\"left\">6 \u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<\/td>\n<td>\n<p align=\"left\">6 \u0442\u0435\u0441\u0442\u043e\u0432 (\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u041f\u0440\u044f\u043c\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 localhost<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041c\u0435\u0442\u0440\u0438\u043a\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">wscpp (linux)<\/p>\n<\/th>\n<th>\n<p align=\"left\">wscpp (ASIO)<\/p>\n<\/th>\n<th>\n<p align=\"left\">ws-rs (tokio)<\/p>\n<\/th>\n<th>\n<p align=\"left\">ws-rs (\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">p50<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,25 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,25 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,26 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,25 \u043c\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">p99<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,36 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,32 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,37 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">0,31 \u043c\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">64 KiB<\/p>\n<\/td>\n<td>\n<p align=\"left\">92 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">82 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">78 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">84 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">ELF<\/p>\n<\/td>\n<td>\n<p align=\"left\">286 \u041a\u0411\u2020<\/p>\n<\/td>\n<td>\n<p align=\"left\">383 \u041a\u0411\u2020<\/p>\n<\/td>\n<td>\n<p align=\"left\">2311 \u041a\u0411<\/p>\n<\/td>\n<td>\n<p align=\"left\">1895 \u041a\u0411<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 <code>.so<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">OpenSSL, zlib<\/p>\n<\/td>\n<td>\n<p align=\"left\">OpenSSL, zlib<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>libc<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>libc<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u2020 OpenSSL \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 ELF \u2014 \u0441\u043c. <a href=\"#%D1%80%D0%B0%D0%B7%D0%BC%D0%B5%D1%80-%D0%B1%D0%B8%D0%BD%D0%B0%D1%80%D0%BD%D0%B8%D0%BA%D0%B0-%D1%87%D1%82%D0%BE-%D0%B8%D0%BC%D0%B5%D0%BD%D0%BD%D0%BE-%D1%81%D1%80%D0%B0%D0%B2%D0%BD%D0%B8%D0%B2%D0%B0%D0%B5%D0%BC\" rel=\"noopener noreferrer nofollow\">\u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044e<\/a>.<\/p>\n<h4>\u041c\u0438\u043a\u0440\u043e\u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0441\u043b\u043e\u044f \u0444\u0440\u0435\u0439\u043c\u043e\u0432<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f<\/p>\n<\/th>\n<th>\n<p align=\"left\">wscpp (\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440)<\/p>\n<\/th>\n<th>\n<p align=\"left\">ws-rs \u0434\u043e v0.4.x<\/p>\n<\/th>\n<th>\n<p align=\"left\">ws-rs v0.4.x<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0421\u0431\u043e\u0440\u043a\u0430 1 MiB<\/p>\n<\/td>\n<td>\n<p align=\"left\">~15 \u0413\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">8886 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">~16 100 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0430\u0440\u0441\u0438\u043d\u0433 1 MiB<\/p>\n<\/td>\n<td>\n<p align=\"left\">~22 \u0413\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">19701 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">~17 100 \u041c\u0411\/\u0441*<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">XOR-\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">~70 \u0413\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">49664 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">~62 600 \u041c\u0411\/\u0441<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>* \u043f\u0443\u0442\u044c \u043f\u0430\u0440\u0441\u0435\u0440\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0441\u044f \u2014 \u0440\u0430\u0437\u0431\u0440\u043e\u0441 \u00b115 % \u043d\u0430 WSL2, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0443\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 <code>memcpy<\/code>.<\/p>\n<h4>\u0427\u0442\u043e \u0434\u0430\u043b \u043f\u0440\u043e\u0445\u043e\u0434 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439 ws-rs (v0.4.x)<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0438\u0442\u0435\u0442 \u0441 wscpp \u0441\u043b\u043e\u0439 ws-rs \u043f\u0440\u043e\u0448\u0435\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 (\u0432\u0441\u0435 \u2014 \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u043c Rust, <code>unsafe_code = \"forbid\"<\/code>):<\/p>\n<ul>\n<li>\n<p><strong>\u041f\u0440\u043e\u0444\u0438\u043b\u044c \u0440\u0435\u043b\u0438\u0437\u0430:<\/strong> <code>lto = \"fat\"<\/code>, <code>codegen-units = 1<\/code>, <code>strip<\/code> \u2014 \u043c\u0435\u0436\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439; \u0442\u0435\u0441\u0442\u044b \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0430 dev-\u043f\u0440\u043e\u0444\u0438\u043b\u0435, \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0430 \u0441\u0442\u0435\u043a\u0430 \u043f\u0440\u0438 \u043f\u0430\u043d\u0438\u043a\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0444\u0440\u0435\u0439\u043c\u0430 \u0432 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434:<\/strong> \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u043c\u0430\u0441\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u2014 \u0431\u044b\u043b\u043e \u0434\u043e \u0442\u0440\u0435\u0445 \u043a\u043e\u043f\u0438\u0439 \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443, \u0441\u0442\u0430\u043b\u043e \u043e\u0434\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><code><strong>Parser::take_frame()<\/strong><\/code><strong>:<\/strong> \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043e\u0442\u0434\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>mem::take<\/code>, \u0431\u0435\u0437 \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 \u0447\u0442\u0435\u043d\u0438\u044f \u0441 \u043a\u0443\u0440\u0441\u043e\u0440\u043e\u043c<\/strong> (\u0447\u0430\u043d\u043a 64 KiB) \u0432 \u043e\u0431\u043e\u0438\u0445 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430\u0445: \u043d\u0435\u0442 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 <code>Vec<\/code> \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 <code>read_frame<\/code>, \u043a\u0443\u0440\u0441\u043e\u0440 \u0443\u0431\u0438\u0440\u0430\u0435\u0442 <code>drain<\/code> \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0431\u0430\u0439\u0442, \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0447\u0442\u0435\u043d\u0438\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u044f\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b. \u041f\u043e\u043f\u0443\u0442\u043d\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0430 \u0441\u043a\u0440\u044b\u0442\u0430\u044f \u043f\u043e\u0442\u0435\u0440\u044f \u0444\u0440\u0435\u0439\u043c\u043e\u0432, \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u0445 \u00ab\u0432 \u0445\u0432\u043e\u0441\u0442\u0435\u00bb \u043e\u0434\u043d\u043e\u0433\u043e <code>read()<\/code>.<\/p>\n<\/li>\n<li>\n<p><code><strong>Cow&lt;[u8]&gt;<\/strong><\/code><strong> \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435:<\/strong> \u043d\u0430 \u043d\u0435\u0441\u0436\u0430\u0442\u043e\u043c (\u0442\u0438\u043f\u0438\u0447\u043d\u043e\u043c) \u043f\u0443\u0442\u0438 \u043d\u0435\u0442 <code>to_vec()<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0442\u043e\u0433: \u0441\u0431\u043e\u0440\u043a\u0430 \u0444\u0440\u0435\u0439\u043c\u0430 \u0432\u044b\u0440\u043e\u0441\u043b\u0430 ~\u0432 1,85 \u0440\u0430\u0437\u0430 \u0438 \u0432\u043f\u043b\u043e\u0442\u043d\u0443\u044e \u043f\u043e\u0434\u043e\u0448\u043b\u0430 \u043a C++ &#8212; \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443 (~16 \u043f\u0440\u043e\u0442\u0438\u0432 ~15 \u0413\u0411\/\u0441), XOR-\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 ~\u0432 1,3 \u0440\u0430\u0437\u0430. \u041f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c 64 KiB \u043d\u0430 localhost \u043f\u043e\u0434\u043d\u044f\u043b\u0430\u0441\u044c \u0441 74 \u0434\u043e ~78 \u041c\u0411\/\u0441 (tokio) \u0438 \u0441 79 \u0434\u043e ~84 \u041c\u0411\/\u0441 (\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0436\u0438\u043c). \u041d\u0430 \u0441\u043a\u0432\u043e\u0437\u043d\u043e\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0435 \u044d\u0445\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0441\u0433\u043b\u0430\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f: \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b, \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0431\u0443\u0444\u0435\u0440 \u0441\u043e\u043a\u0435\u0442\u0430. \u0422\u0435 \u0436\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u2014 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0432\u043b\u0430\u0434\u0435\u043d\u0438\u044f \u0432\u043c\u0435\u0441\u0442\u043e <code>O(n)<\/code>-\u043a\u043e\u043f\u0438\u0438 \u2014 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u0438 fastwebsockets; \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e <code>RUSTFLAGS=\"-C target-cpu=native\"<\/code> \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u0443\u044e \u0430\u0432\u0442\u043e\u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0430\u0441\u043a\u0438 (\u0446\u0435\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430).<\/p>\n<hr\/>\n<h3>\u041f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439<\/h3>\n<h4>wscpp (C++)<\/h4>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><strong>C++11 \u0431\u0435\u0437 Boost<\/strong> \u2014 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 embedded-\u0441\u0431\u043e\u0440\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u0432\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430:<\/strong> linux POSIX (286 \u041a\u0411 ELF) \u0438 ASIO (\u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430);<\/p>\n<\/li>\n<li>\n<p><code><strong>std::error_code<\/strong><\/code><strong> \u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u0443\u0442\u044f\u0445 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430<\/strong> \u2014 \u0431\u0435\u0437 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439; \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0438 <code>-fno-exceptions<\/code>;<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0430\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 ELF<\/strong> \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 C++ &#8212; \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 (OpenSSL \u2014 \u0432 <code>.so<\/code>);<\/p>\n<\/li>\n<li>\n<p><strong>\u042f\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u043e\u0438<\/strong> frame \u2192 connection \u2192 client\/server; 94 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0430 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>ASIO 1.20 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 FetchContent \u0431\u0435\u0437 \u0440\u0443\u0447\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><strong>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441<\/strong>, \u043a\u043e\u0434 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AI \u2014 \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u043e\u043c \u043d\u0443\u0436\u043d\u0430 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430;<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439<\/strong>, \u0447\u0435\u043c \u0443 websocketpp, Beast \u0438\u043b\u0438 libwebsockets;<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430<\/strong> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430 (<code>verify_none<\/code>) \u2014 \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043d\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430;<\/p>\n<\/li>\n<li>\n<p><strong>per-message-deflate<\/strong> \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u044f\u0432\u043d\u043e \u0447\u0435\u0440\u0435\u0437 <code>enable_permessage_deflate()<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 LAN p99 \u0443 linux-\u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 (1,24 \u043c\u0441) \u0445\u0443\u0436\u0435, \u0447\u0435\u043c \u0443 ASIO (0,77 \u043c\u0441) \u2014 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0445\u0432\u043e\u0441\u0442\u043e\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0435 \u043d\u0430 POSIX poll.<\/p>\n<\/li>\n<\/ul>\n<h4>ws-rs (Rust)<\/h4>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><strong>\u0418\u0434\u0438\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439 Rust:<\/strong> <code>Result<\/code>, \u0432\u043b\u0430\u0434\u0435\u043d\u0438\u0435, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 \u0432\u0441\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f clippy \u0442\u0440\u0430\u043a\u0442\u0443\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 CI;<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0430\u0440\u0438\u0442\u0435\u0442 \u0441 wscpp<\/strong> \u2014 \u043e\u0431\u0449\u0438\u0435 RFC-\u0432\u0435\u043a\u0442\u043e\u0440\u044b, \u0437\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u0432\u0430 \u0440\u0435\u0436\u0438\u043c\u0430:<\/strong> tokio \u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 <code>std::net<\/code> \u0431\u0435\u0437 runtime;<\/p>\n<\/li>\n<li>\n<p><strong>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438<\/strong> \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0437\u044b\u043a\u0430; \u043d\u0430 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044c\u043d\u044b\u0445 \u043f\u0443\u0442\u044f\u0445 \u043d\u0435\u0442 panic;<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043f\u0443\u0442\u0438<\/strong> (v0.4.x): \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0444\u0440\u0435\u0439\u043c\u0430 \u0432 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434, \u0431\u0443\u0444\u0435\u0440 \u0447\u0442\u0435\u043d\u0438\u044f \u0441 \u043a\u0443\u0440\u0441\u043e\u0440\u043e\u043c, <code>Cow<\/code> \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u2014 \u0431\u0435\u0437 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0439 \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0432\u0441\u0435 \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u043c Rust;<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0438\u043a\u0440\u043e\u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0444\u0440\u0435\u0439\u043c\u043e\u0432<\/strong> \u2014 \u043e\u0434\u043d\u0438 \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u043d\u0430\u0431\u043e\u0440\u0435 (~63 \u0413\u0411\/\u0441 XOR-\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, ~16 \u0413\u0411\/\u0441 \u0441\u0431\u043e\u0440\u043a\u0430 \u0444\u0440\u0435\u0439\u043c\u0430).<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><strong>\u041a\u0440\u0443\u043f\u043d\u044b\u0439 ELF<\/strong> (~2,3 \u041c\u0411 tokio, ~1,9 \u041c\u0411 blocking) \u2014 rustls\/ring\/flate2 \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430; \u0432\u044b\u0431\u043e\u0440 runtime \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u043e\u043b\u043e\u0434\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/strong>, \u0442\u0430 \u0436\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u0430;<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0435\u043d\u044c\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430<\/strong>, \u0447\u0435\u043c \u0443 tokio-tungstenite;<\/p>\n<\/li>\n<li>\n<p><strong>API \u0441 \u043e\u043f\u0440\u043e\u0441\u043e\u043c<\/strong> (<code>read_message<\/code>, <code>recv_text<\/code>) \u2014 \u043d\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b, \u043a\u0430\u043a \u0432 C++; \u043f\u0440\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0446\u0438\u043a\u043b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c (\u0448\u0438\u0440\u043e\u043a\u0438\u0439 \u0432\u0437\u0433\u043b\u044f\u0434)<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439<\/p>\n<\/th>\n<th>\n<p align=\"left\">C++<\/p>\n<\/th>\n<th>\n<p align=\"left\">Rust<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Legacy C++11, \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/td>\n<td>\n<p align=\"left\">wscpp linux \/ easywsclient<\/p>\n<\/td>\n<td>\n<p align=\"left\">ws-rs std-blocking<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/td>\n<td>\n<p align=\"left\">websocketpp, Beast<\/p>\n<\/td>\n<td>\n<p align=\"left\">tokio-tungstenite<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \/ \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 SDK<\/p>\n<\/td>\n<td>\n<p align=\"left\">IXWebSocket<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2014<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0417\u0440\u0435\u043b\u044b\u0439 C-\u0441\u0442\u0435\u043a \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">libwebsockets<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2014<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0411\u0435\u0437 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/p>\n<\/td>\n<td>\n<p align=\"left\">wscpp<\/p>\n<\/td>\n<td>\n<p align=\"left\">Rust \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 ELF \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 (\u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u0442\u0435\u043a)<\/p>\n<\/td>\n<td>\n<p align=\"left\">wscpp 286 \u041a\u0411 (+ OpenSSL <code>.so<\/code>)<\/p>\n<\/td>\n<td>\n<p align=\"left\">ws-rs blocking 1895 \u041a\u0411 (TLS \u0432\u043d\u0443\u0442\u0440\u0438)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041a\u0440\u043e\u0441\u0441-\u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f RFC<\/p>\n<\/td>\n<td>\n<p align=\"left\">wscpp + ws-rs \u0432\u043c\u0435\u0441\u0442\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">wscpp + ws-rs \u0432\u043c\u0435\u0441\u0442\u0435<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<hr\/>\n<h3>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0417\u0430\u0434\u0430\u0447\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Embedded \/ \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 ELF \u043d\u0430 C++11 (OpenSSL \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435)<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>wscpp<\/strong> <code>WSCPP_USE_ASIO=OFF<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Embedded \u0431\u0435\u0437 OpenSSL \u0432 \u043e\u0431\u0440\u0430\u0437\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c: C++ ELF + <code>.so<\/code> \u043f\u0440\u043e\u0442\u0438\u0432 Rust ELF \u0441 rustls<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 ASIO-\u043f\u0440\u043e\u0435\u043a\u0442<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>wscpp<\/strong> ASIO \u0438\u043b\u0438 <strong>websocketpp<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Rust + tokio \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>tokio-tungstenite<\/strong> (\u0437\u0440\u0435\u043b\u043e\u0441\u0442\u044c) \u0438\u043b\u0438 <strong>ws-rs<\/strong> (RFC-\u043f\u0430\u0440\u0438\u0442\u0435\u0442 \u0441 wscpp)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0411\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 Rust \u0431\u0435\u0437 async runtime<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>ws-rs<\/strong> <code>--no-default-features --features std-blocking,...<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u0431\u0435\u0437 \u0440\u0435\u0432\u044c\u044e \u043a\u043e\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u041d\u0438 wscpp, \u043d\u0438 ws-rs<\/strong> \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0430\u0443\u0434\u0438\u0442; \u0434\u043b\u044f C++ \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 Beast\/libwebsockets<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041d\u0443\u0436\u0435\u043d per-message-deflate<\/p>\n<\/td>\n<td>\n<p align=\"left\">wscpp 1.1+, IXWebSocket, Beast, libwebsockets, ws-rs 0.3+<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<hr\/>\n<h3>\u041a\u0430\u043a \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438<\/h3>\n<p><strong>C++ \u2014 \u043e\u0431\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0430\u043c\u0438:<\/strong><\/p>\n<pre><code class=\"bash\"># \u0414\u043b\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 ELF \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:cmake -B build-bench-linux -DWSCPP_BUILD_BENCHMARKS=ON \\  -DWSCPP_USE_ASIO=OFF -DWSCPP_ENABLE_LOGGING=OFF -DCMAKE_BUILD_TYPE=Releasecmake --build build-bench-linux --target run_benchmarks -j\"$(nproc)\"bash benchmarks\/run_benchmarks_both.shbash benchmarks\/run_remote_network_compare.sh<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>Rust:<\/strong><\/p>\n<pre><code class=\"bash\">bash rust\/benchmarks\/run_benchmarks.shbash rust\/benchmarks\/run_remote_network_compare.sh<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043e\u043b\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0436\u0443\u0440\u043d\u0430\u043b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439: <a href=\"https:\/\/github.com\/gvtret\/wscpp\/blob\/master\/ANALYSIS.md\" rel=\"noopener noreferrer nofollow\">ANALYSIS.md<\/a>, <a href=\"https:\/\/github.com\/gvtret\/wscpp\/blob\/master\/ANALYSIS_RUST.md\" rel=\"noopener noreferrer nofollow\">ANALYSIS_RUST.md<\/a>.<\/p>\n<hr\/>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b WebSocket \u043d\u0430 C++11 \u0438 Rust <strong>\u043d\u0435 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 \u00ab\u0431\u044b\u0441\u0442\u0440\u044b\u0435\u00bb \u0438 \u00ab\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435\u00bb<\/strong> \u043d\u0430 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445 \u044d\u0445\u043e-\u043e\u0442\u0432\u0435\u0442\u0430: \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u043d\u0430 localhost \u0443 \u0432\u0441\u0435\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u043b\u0438 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0444\u0430\u043a\u0442\u043e\u0440\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p><strong>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u044f\u0437\u044b\u043a\u0430 \u0438 toolchain<\/strong> (C++11 vs Rust 2021);<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u043e\u0434\u0435\u043b\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430<\/strong> (\u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b + \u043f\u043e\u0442\u043e\u043a vs async\/await vs \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 <code>std::net<\/code>);<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0437\u043c\u0435\u0440 \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438<\/strong> (286 \u041a\u0411 ELF wscpp + OpenSSL <code>.so<\/code> vs 1,9\u20132,3 \u041c\u0411 ws-rs \u0441 TLS \u0432\u043d\u0443\u0442\u0440\u0438 ELF);<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a<\/strong> (<code>error_code<\/code> vs <code>Result<\/code>);<\/p>\n<\/li>\n<li>\n<p><strong>\u0417\u0440\u0435\u043b\u043e\u0441\u0442\u044c \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e<\/strong> (Beast, libwebsockets, tokio-tungstenite vs \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 wscpp\/ws-rs).<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0430\u0440\u0430 wscpp + ws-rs \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u043a\u0430\u043a <strong>RFC \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 \u0434\u0432\u0443\u0445 \u044f\u0437\u044b\u043a\u0430\u0445<\/strong>: \u043e\u0434\u0438\u043d \u043d\u0430\u0431\u043e\u0440 RFC-\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439, \u043e\u0431\u0449\u0438\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b, \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c\u044b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0441\u0442\u0435\u043d\u0434\u044b \u2014 \u0440\u0435\u0434\u043a\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u00ab\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043b\u0438 \u043c\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c RFC 6455\u00bb, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1044686\/\">https:\/\/habr.com\/ru\/articles\/1044686\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WebSocket \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438: \u0447\u0430\u0442\u044b, \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0435 \u043a\u043e\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u044b, IoT. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u044b\u0431\u043e\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0440\u0435\u0434\u043a\u043e \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u00ab\u043a\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0430\u0440\u0441\u0438\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0444\u0440\u0435\u0439\u043c\u0430\u00bb. \u0412\u0430\u0436\u043d\u0435\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 TLS, \u0441\u0436\u0430\u0442\u0438\u044f per-message-deflate, \u043c\u043e\u0434\u0435\u043b\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438, \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a.\u0412 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 wscpp \u043b\u0435\u0436\u0430\u0442 \u0434\u0432\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435, \u043d\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430:wscpp \u2014 C++11, \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440, \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f MIT;ws-rs \u2014 Rust-\u043a\u043e\u043c\u043f\u0430\u043d\u044c\u043e\u043d \u0441 \u0442\u043e\u0439 \u0436\u0435 \u043f\u043e\u0441\u043b\u043e\u0439\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439 \u0438 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 RFC 6455 \u00a75.7.\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440: \u043e\u0431\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AI-\u0430\u0433\u0435\u043d\u0442\u043e\u0432; \u043b\u044e\u0434\u0438 \u043a\u0443\u0440\u0438\u0440\u0443\u044e\u0442 \u0442\u0435\u0441\u0442\u044b, CI \u0438 \u0440\u0435\u043b\u0438\u0437\u044b. \u041d\u0438\u0436\u0435 \u2014 \u043d\u0435 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u044b\u0439 \u043e\u0431\u0437\u043e\u0440, \u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0446\u0438\u0444\u0440\u0430\u043c\u0438.\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440: \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u2014 7 \u0438\u044e\u043d\u044f 2026; \u0440\u0430\u0437\u043c\u0435\u0440\u044b ELF \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u044b 8 \u0438\u044e\u043d\u044f 2026. \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430: Linux\/WSL2 (GCC 15), Release; \u0432 LAN \u2014 Debian 13 VM, RTT ~0,5\u20130,7 \u043c\u0441. \u0412 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 TLS \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f (\u043d\u043e \u043a\u043e\u0434 TLS\/deflate \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0432 \u0441\u0431\u043e\u0440\u043a\u0443). \u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u2014 \u043e\u0434\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435.\u041c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f\u041f\u043e\u0440\u043e\u0433 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 RFC\u0411\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430\u0431\u043e\u0440\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439:RFC\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u0421\u0442\u0430\u0442\u0443\u0441 wscpp \/ ws-rsRFC 6455\u0424\u0440\u0435\u0439\u043c\u044b, \u0440\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435, \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435, ping\/pong, \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f, UTF-8 \u00a78.1\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043eRFC 2818wss:\/\/, SNI\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043eRFC 7692\u0421\u0436\u0430\u0442\u0438\u0435 per-message-deflate\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439\u0427\u0442\u043e \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c\u0417\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u044d\u0445\u043e-\u043e\u0442\u0432\u0435\u0442\u0430 (p50\/p99)100 \u0446\u0438\u043a\u043b\u043e\u0432 \u00ab\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u2014 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u00bb \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c ping-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u043d\u0430 localhost \u0438 \u0432 LAN\u041f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c 64 KiB100 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439\u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u0438 \u0441\u0431\u043e\u0440\u043a\u0430 \u0444\u0440\u0435\u0439\u043c\u043e\u04321 MiB, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u043a\u0440\u043e\u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a (\u0442\u043e\u043b\u044c\u043a\u043e CPU)\u0417\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u0422\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a (easywsclient)\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f: \u043e\u0434\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0433\u043e\u043d; \u0432 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u043d\u0435\u0442 TLS; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 LAN \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u2014 \u043d\u0430 localhost \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0442 \u043c\u0438\u043a\u0440\u043e\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0430\u0440\u0441\u0435\u0440\u0430, \u0432 LAN \u2014 \u0441\u0435\u0442\u0435\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0430 \u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u041e\u0421.\u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430: \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c\u0412\u043e \u0432\u0441\u0435\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 ELF-\u0444\u0430\u0439\u043b\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 (stat -c%s \u043d\u0430 bench_*_roundtrip), Release-\u0441\u0431\u043e\u0440\u043a\u0430. \u042d\u0442\u043e \u043d\u0435 \u00ab\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439\u00bb \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442 \u0438 \u043d\u0435 \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435.\u0421\u0442\u0435\u043a\u0427\u0442\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 ELF\u0427\u0442\u043e \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0440\u0443\u0436\u0438 (\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 .so)wscpp (C++)\u043a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (libwscpp.a \u043b\u0438\u043d\u043a\u0443\u0435\u0442\u0441\u044f \u0432 exe)OpenSSL (libssl, libcrypto), zlib, libstdc++, libcws-rs (Rust)rustls, ring, flate2, tokio (\u0435\u0441\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d)\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c libc, libgcc_slibwebsockets\u0442\u043e\u043d\u043a\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430libwebsockets.so \u0438 \u0435\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438\u0421\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0434\u043b\u044f \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f:C++ &#8212; \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043c\u0435\u043d\u044c\u0448\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f (OpenSSL ~7 \u041c\u0411 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 .so) \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 ELF. \u041d\u0430 \u00ab\u0433\u043e\u043b\u043e\u0439\u00bb \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0431\u0435\u0437 OpenSSL \u044d\u0442\u0438 .so \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.Rust &#8212; \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0431\u043e\u043b\u044c\u0448\u0435, \u043a\u0430\u043a \u0444\u0430\u0439\u043b, \u043d\u043e \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0435\u0435: TLS \u0438 deflate \u0432\u0448\u0438\u0442\u044b \u0432 ELF.\u041f\u0440\u044f\u043c\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u00ab286 \u041a\u0411 C++ vs 1,9 \u041c\u0411 Rust\u00bb \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0444\u0430\u0439\u043b\u0430 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0431\u0435\u0437 \u044d\u0442\u043e\u0439 \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u0438. \u0414\u043b\u044f embedded \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e ELF, \u043d\u043e \u0438 \u0442\u043e, \u0435\u0441\u0442\u044c \u043b\u0438 OpenSSL \u0432 \u043e\u0431\u0440\u0430\u0437\u0435.C++ &#8212; \u0437\u0430\u043c\u0435\u0440\u044b: WSCPP_ENABLE_LOGGING=OFF (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u0438 \u0434\u0430\u0435\u0442 ~650 \u041a\u0411 \u0432\u043c\u0435\u0441\u0442\u043e ~286 \u041a\u0411). Rust-\u0437\u0430\u043c\u0435\u0440\u044b: [profile.release] \u0441 lto = &#171;fat&#187;, strip = true \u0432 rust\/Cargo.toml.\u0427\u0430\u0441\u0442\u044c 1. \u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 WebSocket \u0434\u043b\u044f C++11\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u043e\u0442\u0431\u043e\u0440\u0430\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u043e\u043f\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 C++11 (\u0438\u043b\u0438 C API, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u0437 C++11 \u0431\u0435\u0437 \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430). \u0420\u0435\u0448\u0435\u043d\u0438\u044f, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 C++17 \u0438 \u0432\u044b\u0448\u0435 (uWebSockets, Poco Net 1.13+, seasocks), \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u044b.\u041f\u0435\u0440\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c: \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430C++11TLS\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438websocketpp\u0434\u0430\u0434\u0430ASIOASIO, OpenSSLBoost.Beast\u0434\u0430\u0434\u0430Boost.AsioBoost, OpenSSLIXWebSocket\u0434\u0430\u0434\u0430\u043f\u043e\u0442\u043e\u043a\u0438zlib, OpenSSL\/MbedTLSSimple-WebSocket-Server\u0434\u0430\u0434\u0430ASIOASIO, OpenSSLwscpp\u0434\u0430\u0434\u0430ASIO \u0438\u043b\u0438 POSIXASIO\u2020 \u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e OpenSSL\u2020 ASIO 1.20 \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 FetchContent \u043f\u0440\u0438 WSCPP_USE_ASIO=ON.\u0412\u0442\u043e\u0440\u043e\u0439 \u0438 \u0442\u0440\u0435\u0442\u0438\u0439 \u0443\u0440\u043e\u0432\u043d\u0438: \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u044b \u0438 C-\u0441\u0442\u0435\u043a\u0438easywsclient (~600 \u0441\u0442\u0440\u043e\u043a) \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0438\u0435\u043d\u0442, \u0431\u0435\u0437 TLS;libwebsockets \u2014 \u0437\u0440\u0435\u043b\u044b\u0439 production-\u0441\u0442\u0435\u043a \u043d\u0430 C, \u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 localhost (\u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u044d\u0445\u043e \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430)\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430p50p9964 KiB\u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430wscpp (linux POSIX)0,25 \u043c\u04410,36 \u043c\u044192 \u041c\u0411\/\u0441286 \u041a\u0411\u2020wscpp (ASIO)0,25 \u043c\u04410,32 \u043c\u044182 \u041c\u0411\/\u0441383 \u041a\u0411\u2020websocketpp 0.8.20,31 \u043c\u04410,59 \u043c\u0441\u2014687 \u041a\u0411IXWebSocket 11.4.60,28 \u043c\u04410,68 \u043c\u044162 \u041c\u0411\/\u0441473 \u041a\u0411libwebsockets 4.3.50,26 \u043c\u04410,40 \u043c\u0441\u2014126 \u041a\u0411*Boost.Beast 1.880,25 \u043c\u04410,32 \u043c\u044168 \u041c\u0411\/\u0441667 \u041a\u0411Simple-WebSocket-Server0,28 \u043c\u04410,46 \u043c\u0441\u2014675 \u041a\u0411* libwebsockets \u043b\u0438\u043d\u043a\u0443\u0435\u0442\u0441\u044f \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 .so \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 ELF \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0430\u043c\u0438, \u0433\u0434\u0435 OpenSSL \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.\u2020 \u0440\u0430\u0437\u043c\u0435\u0440 ELF; OpenSSL \u0438 zlib \u2014 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 .so (\u0441\u043c. \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044e).\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 (\u0434\u0432\u0435 \u043c\u0430\u0448\u0438\u043d\u044b, plain ws:\/\/)\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430p50p9964 KiBwscpp (linux)0,34 \u043c\u04411,24 \u043c\u044127 \u041c\u0411\/\u0441wscpp (ASIO)0,40 \u043c\u04410,77 \u043c\u044128 \u041c\u0411\/\u0441websocketpp0,32 \u043c\u04412,01 \u043c\u0441\u2014IXWebSocket0,42 \u043c\u04410,85 \u043c\u044131 \u041c\u0411\/\u0441libwebsockets0,33 \u043c\u04413,55 \u043c\u0441\u2014Beast0,32 \u043c\u04410,86 \u043c\u044129 \u041c\u0411\/\u0441\u0412\u044b\u0432\u043e\u0434 \u043f\u043e C++: \u043f\u043e \u043c\u0435\u0434\u0438\u0430\u043d\u0435 (p50) \u043d\u0430 localhost \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 ~0,25\u20130,31 \u043c\u0441. \u0420\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0437\u0430\u043c\u0435\u0442\u043d\u0435\u0435 \u0432 \u0445\u0432\u043e\u0441\u0442\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (p99): websocketpp \u0438 libwebsockets \u043d\u0430 LAN \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041e\u0441\u043e\u0431\u043d\u044f\u043a\u043e\u043c \u0441\u0442\u043e\u044f\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 ELF \u0438 \u043c\u043e\u0434\u0435\u043b\u044c API. \u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442 wscpp \u043d\u0430 POSIX-\u0441\u043e\u043a\u0435\u0442\u0430\u0445 \u0434\u0430\u0435\u0442 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 C++ &#8212; \u0441\u0442\u0435\u043a\u043e\u0432 \u2014 \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e OpenSSL \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.wscpp: \u0434\u0432\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430# \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 ELF \u2014 POSIX, OpenSSL \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438cmake -B build-linux -DWSCPP_BUILD_BENCHMARKS=ON \\  -DWSCPP_USE_ASIO=OFF -DWSCPP_ENABLE_LOGGING=OFF# \u041a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 ASIOcmake -B build-asio -DWSCPP_BUILD_BENCHMARKS=ON \\  -DWSCPP_USE_ASIO=ON -DWSCPP_ENABLE_LOGGING=OFF\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442p50p9964 KiBELF (\u041a\u0438\u0411)linux POSIX0,25 \u043c\u04410,36 \u043c\u044192 \u041c\u0411\/\u0441286 \u041a\u0411ASIO0,25 \u043c\u04410,32 \u043c\u044182 \u041c\u0411\/\u0441383 \u041a\u0411\u041c\u0438\u043a\u0440\u043e\u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0441\u043b\u043e\u044f \u0444\u0440\u0435\u0439\u043c\u043e\u0432 (\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430):\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u041f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c\u0421\u0431\u043e\u0440\u043a\u0430 \u0444\u0440\u0435\u0439\u043c\u0430~15 \u0413\u0411\/\u0441\u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u0444\u0440\u0435\u0439\u043c\u0430~22 \u0413\u0411\/\u0441XOR-\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435~70 \u0413\u0411\/\u0441\u0427\u0430\u0441\u0442\u044c 2. \u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 WebSocket \u0434\u043b\u044f Rust\u041f\u0435\u0440\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c: \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 tokio\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0421\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044fTLS\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044ftokio-tungstenitetokiorustls\/native-tlsMITfastwebsocketstokio \/ \u0440\u0443\u0447\u043d\u043e\u0439 \u0440\u0435\u0436\u0438\u043crustlsApache-2.0tokio-websocketstokiorustlsMITws-rstokio + \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0436\u0438\u043crustlsMIT\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 localhost\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430p50p9964 KiBELF (\u041a\u0438\u0411)ws-rs (tokio)0,26 \u043c\u04410,37 \u043c\u044178 \u041c\u0411\/\u04412311 \u041a\u0411ws-rs (\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439)0,25 \u043c\u04410,31 \u043c\u044184 \u041c\u0411\/\u04411895 \u041a\u0411tokio-tungstenite0,30 \u043c\u04410,41 \u043c\u044176 \u041c\u0411\/\u0441856 \u041a\u0411fastwebsockets0,29 \u043c\u04410,55 \u043c\u044183 \u041c\u0411\/\u04411037 \u041a\u0411tokio-websockets0,31 \u043c\u04410,44 \u043c\u044185 \u041c\u0411\/\u0441779 \u041a\u0411\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430p50p9964 KiBws-rs (tokio)0,35 \u043c\u04410,51 \u043c\u044130 \u041c\u0411\/\u0441ws-rs (\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439)0,40 \u043c\u04410,51 \u043c\u044130 \u041c\u0411\/\u0441tokio-tungstenite0,37 \u043c\u04410,67 \u043c\u044130 \u041c\u0411\/\u0441fastwebsockets0,36 \u043c\u04410,60 \u043c\u044130 \u041c\u0411\/\u0441tokio-websockets0,38 \u043c\u04410,67 \u043c\u044130 \u041c\u0411\/\u0441\u0412\u044b\u0432\u043e\u0434 \u043f\u043e Rust: tokio-tungstenite \u2014 \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b. fastwebsockets \u0438 tokio-websockets \u043a\u043e\u043d\u043a\u0443\u0440\u0438\u0440\u0443\u044e\u0442 \u043f\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 localhost. \u041f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 ELF ws-rs \u0442\u044f\u0436\u0435\u043b\u0435\u0435 wscpp: \u0432 Rust-\u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0432\u0448\u0438\u0442\u044b rustls, ring \u0438 flate2, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0443 C++ OpenSSL \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432 .so. \u0411\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 bench_blocking_roundtrip (~1,9 \u041c\u0411) \u043c\u0435\u043d\u044c\u0448\u0435 tokio-\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 (~2,3 \u041c\u0411), \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043a\u0440\u0443\u043f\u043d\u0435\u0435 C++ ELF (~286 \u041a\u0411) \u2014 \u0437\u0430\u0442\u043e \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u0435\u0435 \u043f\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c.\u0417\u0430\u043c\u0435\u0440\u044b Rust \u2014 \u0447\u0435\u0440\u0435\u0437 cargo build &#8212;release -p ws-rs-benches &#8212;bins (\u0432\u0441\u0435 default-features ws-rs). \u0414\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0435\u0437 tokio \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438:cargo build -p ws-rs &#8212;release &#8212;no-default-features \\  &#8212;features &#171;std-blocking,deflate,blocking-tls&#187;\u0420\u0430\u0437\u043c\u0435\u0440 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e bench_blocking_roundtrip, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043b\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 C++ &#8212; \u0441\u0442\u0435\u043a\u043e\u043c.\u0412 LAN \u0432\u0441\u0435 \u0447\u0435\u0442\u044b\u0440\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043a ~30 \u041c\u0411\/\u0441 \u2014 \u0443\u043f\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0435\u0442\u044c, \u0430 \u043d\u0435 \u0432 \u043f\u0430\u0440\u0441\u0435\u0440.\u0427\u0430\u0441\u0442\u044c 3. C++ \u0438 Rust: \u043e\u0434\u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430, \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b\u041f\u0440\u043e\u0435\u043a\u0442 wscpp \u2014 \u0440\u0435\u0434\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0434\u0432\u0430\u0436\u0434\u044b \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u0437\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0441\u0442\u0435\u043d\u0434\u0430\u043c\u0438.\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0421\u043b\u043e\u0439wscpp (C++)ws-rs (Rust)\u0424\u0440\u0435\u0439\u043c\u044bframe::parser \/ builderframe::Parser \/ FrameBuilder\u0420\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435handshakehandshake\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043f\u043e\u0442\u043e\u043a + \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442tokio TcpStream \u0438\u043b\u0438 std::net\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 APIclient, server (\u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b)Client, Server (\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043e\u043f\u0440\u043e\u0441)\u041e\u0448\u0438\u0431\u043a\u0438std::error_codeResult&lt;T, Error&gt;TLSOpenSSLrustls\u041f\u0430\u0440\u0438\u0442\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0439\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044cwscppws-rsRFC 6455\u0434\u0430\u0434\u0430wss:\/\/OpenSSLrustlsper-message-deflate\u0434\u0430 (v1.1.0)\u0434\u0430 (v0.3.0+)\u0414\u0432\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430ASIO \/ linux POSIXtokio \/ std-blocking\u0412\u0435\u043a\u0442\u043e\u0440\u044b \u00a75.76 \u0442\u0435\u0441\u0442\u043e\u04326 \u0442\u0435\u0441\u0442\u043e\u0432 (\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b)\u041f\u0440\u044f\u043c\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 localhost\u041c\u0435\u0442\u0440\u0438\u043a\u0430wscpp (linux)wscpp (ASIO)ws-rs (tokio)ws-rs (\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439)p500,25 \u043c\u04410,25 \u043c\u04410,26 \u043c\u04410,25 \u043c\u0441p990,36 \u043c\u04410,32 \u043c\u04410,37 \u043c\u04410,31 \u043c\u044164 KiB92 \u041c\u0411\/\u044182 \u041c\u0411\/\u044178 \u041c\u0411\/\u044184 \u041c\u0411\/\u0441ELF286 \u041a\u0411\u2020383 \u041a\u0411\u20202311 \u041a\u04111895 \u041a\u0411\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 .soOpenSSL, zlibOpenSSL, zliblibclibc\u2020 OpenSSL \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 ELF \u2014 \u0441\u043c. \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044e.\u041c\u0438\u043a\u0440\u043e\u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0441\u043b\u043e\u044f \u0444\u0440\u0435\u0439\u043c\u043e\u0432\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044fwscpp (\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440)ws-rs \u0434\u043e v0.4.xws-rs v0.4.x\u0421\u0431\u043e\u0440\u043a\u0430 1 MiB~15 \u0413\u0411\/\u04418886 \u041c\u0411\/\u0441~16 100 \u041c\u0411\/\u0441\u041f\u0430\u0440\u0441\u0438\u043d\u0433 1 MiB~22 \u0413\u0411\/\u044119701 \u041c\u0411\/\u0441~17 100 \u041c\u0411\/\u0441*XOR-\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435~70 \u0413\u0411\/\u044149664 \u041c\u0411\/\u0441~62 600 \u041c\u0411\/\u0441* \u043f\u0443\u0442\u044c \u043f\u0430\u0440\u0441\u0435\u0440\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0441\u044f \u2014 \u0440\u0430\u0437\u0431\u0440\u043e\u0441 \u00b115 % \u043d\u0430 WSL2, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0443\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 memcpy.\u0427\u0442\u043e \u0434\u0430\u043b \u043f\u0440\u043e\u0445\u043e\u0434 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439 ws-rs (v0.4.x)\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0438\u0442\u0435\u0442 \u0441 wscpp \u0441\u043b\u043e\u0439 ws-rs \u043f\u0440\u043e\u0448\u0435\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 (\u0432\u0441\u0435 \u2014 \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u043c Rust, unsafe_code = &#171;forbid&#187;):\u041f\u0440\u043e\u0444\u0438\u043b\u044c \u0440\u0435\u043b\u0438\u0437\u0430: lto = &#171;fat&#187;, codegen-units = 1, strip \u2014 \u043c\u0435\u0436\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439; \u0442\u0435\u0441\u0442\u044b \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0430 dev-\u043f\u0440\u043e\u0444\u0438\u043b\u0435, \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0430 \u0441\u0442\u0435\u043a\u0430 \u043f\u0440\u0438 \u043f\u0430\u043d\u0438\u043a\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0430.\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0444\u0440\u0435\u0439\u043c\u0430 \u0432 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434: \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u043c\u0430\u0441\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u2014 \u0431\u044b\u043b\u043e \u0434\u043e \u0442\u0440\u0435\u0445 \u043a\u043e\u043f\u0438\u0439 \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443, \u0441\u0442\u0430\u043b\u043e \u043e\u0434\u043d\u0430.Parser::take_frame(): \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043e\u0442\u0434\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 mem::take, \u0431\u0435\u0437 \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 \u0447\u0442\u0435\u043d\u0438\u044f \u0441 \u043a\u0443\u0440\u0441\u043e\u0440\u043e\u043c (\u0447\u0430\u043d\u043a 64 KiB) \u0432 \u043e\u0431\u043e\u0438\u0445 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430\u0445: \u043d\u0435\u0442 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 Vec \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 read_frame, \u043a\u0443\u0440\u0441\u043e\u0440 \u0443\u0431\u0438\u0440\u0430\u0435\u0442 drain \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0431\u0430\u0439\u0442, \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0447\u0442\u0435\u043d\u0438\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u044f\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b. \u041f\u043e\u043f\u0443\u0442\u043d\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0430 \u0441\u043a\u0440\u044b\u0442\u0430\u044f \u043f\u043e\u0442\u0435\u0440\u044f \u0444\u0440\u0435\u0439\u043c\u043e\u0432, \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u0445 \u00ab\u0432 \u0445\u0432\u043e\u0441\u0442\u0435\u00bb \u043e\u0434\u043d\u043e\u0433\u043e read().Cow&lt;[u8]&gt; \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435: \u043d\u0430 \u043d\u0435\u0441\u0436\u0430\u0442\u043e\u043c (\u0442\u0438\u043f\u0438\u0447\u043d\u043e\u043c) \u043f\u0443\u0442\u0438 \u043d\u0435\u0442 to_vec().\u0418\u0442\u043e\u0433: \u0441\u0431\u043e\u0440\u043a\u0430 \u0444\u0440\u0435\u0439\u043c\u0430 \u0432\u044b\u0440\u043e\u0441\u043b\u0430 ~\u0432 1,85 \u0440\u0430\u0437\u0430 \u0438 \u0432\u043f\u043b\u043e\u0442\u043d\u0443\u044e \u043f\u043e\u0434\u043e\u0448\u043b\u0430 \u043a C++ &#8212; \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443 (~16 \u043f\u0440\u043e\u0442\u0438\u0432 ~15 \u0413\u0411\/\u0441), XOR-\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 ~\u0432 1,3 \u0440\u0430\u0437\u0430. \u041f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c 64 KiB \u043d\u0430 localhost \u043f\u043e\u0434\u043d\u044f\u043b\u0430\u0441\u044c \u0441 74 \u0434\u043e ~78 \u041c\u0411\/\u0441 (tokio) \u0438 \u0441 79 \u0434\u043e ~84 \u041c\u0411\/\u0441&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-482732","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/482732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=482732"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/482732\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=482732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=482732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=482732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}