Improve time tracking overheads a bit 68/83268/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 25 Jul 2019 22:38:30 +0000 (00:38 +0200)
committerRobert Varga <nite@hq.sk>
Fri, 26 Jul 2019 08:49:44 +0000 (08:49 +0000)
commitf8ac7fd0c50d1f6eac4b81d85594bfbe7914ce58
treec00567036a9b12844437b25394d2b5c1b72a333c
parent0b689bf78e783c242d02c9d7fcb787b8a587ba3d
Improve time tracking overheads a bit

We are performing unneeded computation when we are rescheduling
the keepalive timer:
- we always convert the keepAlive timer from seconds to nanos
  when checking expiry
- we are forcing netty to translate seconds to nanos again when
  we are re-scheduling the timer
- we end up doing a superfluous addition, which then undone when
  we are computing the next duration

This normalizes all the timer delays to nanoseconds, so we
eliminate these inefficiencies.

JIRA: BGPCEP-872
Change-Id: Ic5912020a1cfa0df4fc6d4cf401d846cd9140ee4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7fbf2d3b2ef7b03fab9208e03a27e053acd415e2)
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImpl.java