remove NTCP bottlenecks (some)
Opened 14 months ago
Last modified 10 months ago
#2701openenhancement
remove NTCP bottlenecks (some)
Reported by:joggerOwned by:zzz Priority: minor Milestone: undecided Component: router/transport Version: 0.9.46 Keywords:
Cc: Zlatin Balevsky Parent Tickets:
Sensitive: no
Description
While profiling NTCP I found some areas eating lots of CPU. Following are easy to fix:
-
Syncing on a method that retrieves just one field does nothing. Many occurrences in the transport, NTCPConnection.isEstablished() eats most.
-
_conlock also blocks a lot. Suggest using the double check idiom in NTCPTransport.outboundMessageReady()
con = _conByIdent.get(ih);
if (con == null) {
synchronized (_conLock) {
con = _conByIdent.get(ih);
if (con == null) {