Slow performance caused by `get_remote_ip_and_port` and `get_local_ip_and_port`
Closed this issue · 1 comments
yhirose commented
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
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.
yhirose commented
To avoid the breaking change, we can share the same information per socket connection. In other words, we can share it over requests in the same KeepAlive connection.