-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Description
Currently, one of bottle necks of performance is caused by get_remote_ip_and_port
and get_local_ip_and_port
.

Lines 6961 to 6967 in 61c4180
strm.get_remote_ip_and_port(req.remote_addr, req.remote_port); | |
req.set_header("REMOTE_ADDR", req.remote_addr); | |
req.set_header("REMOTE_PORT", std::to_string(req.remote_port)); | |
strm.get_local_ip_and_port(req.local_addr, req.local_port); | |
req.set_header("LOCAL_ADDR", req.local_addr); | |
req.set_header("LOCAL_PORT", std::to_string(req.local_port)); |
These slow functions are called regardless of whether REMOTE_ADDR
, REMOTE_PORT
, LOCAL_ADDR
, or LOCAL_PORT
will be used later on.
I am thinking of making them "lazy evaluation" calls, so that we don't have to pay such costs.
REMOTE_ADDR
,REMOTE_PORT
,LOCAL_ADDR
,LOCAL_PORT
will be removed fromRequest
remote_addr
,remote_port
,local_addr
,local_port
will be removed fromRequest
get_remote_ip
,get_remote_port
,get_local_ip
andget_local_port
will be added
This will be a break change, and will be available from v0.18.0.
Spixmaster