Skip to content
/ uv-cpp Public
forked from wlgq2/uv-cpp

libuv wrapper in C++11 /libuv C++11网络库

License

Notifications You must be signed in to change notification settings

Raobian/uv-cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uv-cpp

Github release Platform License Project Status: Active – The project has reached a stable, usable state and is being actively developed.


Language Translations:


uv-cpp is a simple interface, high-performance network library based on C++11.

Dependencies

Features

  • C++11 functional/bind style callback instead of C-style function pointer.
  • TCP and UDP wrapper.
  • DNSandHttp:DNS query and http support,Http routing based on radix tree.
  • TimerandTimerWheel:Heartbeat timeout judgment with time complexity of O(1).
  • Async:libuv async wrapper,but optimized the problem of calling multiple times but callback will only be called once.
  • PacketandPacketBuffer:Send and receive packet of Tcp data stream. Support custom data packet structure (such as uvnsq)
  • Log interface.

Build Instructions

  • VS2017 (windows)
  • Codeblocks (linux)
  • CMake (linux)

Benchmark

ping-pong VS boost.asio-1.67


environment:Intel Core i5 8265U + debian8 + gcc8.3.0 + libuv1.30.0 + '-O2'

size peer pack 1K bytes 2K bytes 4K bytes 8K bytes
uv-cpp 16138 kbyte 32071 kbyte 59264 kbyte 123813 kbyte
boost.asio 16119 kbyte 31566 kbyte 58322 kbyte 126210 kbyte

asio1


environment:i5-8265U + 4G memory + 4k bytes ping-pong

concurrency 10 100 1000 5000
uv-cpp 654282 kbyte 591869 kbyte 401500 kbyte 412855 kbyte
boost.asio 633818 kbyte 585716 kbyte 371386 kbyte 382402 kbyte

asio2

Apache bench VS nginx-1.14.2


environment:Intel Core i5 8265U + debian8 + gcc8.3.0 + libuv1.30.0 + '-O2'

1000 concurrency && 100000 request.
uv_http nginx_http

Quick start