summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-29 23:21:20 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-29 23:21:20 +0900
commit70a8399e0dab0d9ee4c11959721e48e87ef261c0 (patch)
tree4eafa7ea3f5b02e3445d213a53c5e818fe5166d7 /table
parentc46d51f46ae704aa724b295ecc0bbf54f9a4fc78 (diff)
table: disable merging NLRIs if we don't have many NLRIs
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r--table/message.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/table/message.go b/table/message.go
index c5dfb4d4..0066fc36 100644
--- a/table/message.go
+++ b/table/message.go
@@ -193,9 +193,14 @@ func CreateUpdateMsgFromPaths(pathList []*Path) []*bgp.BGPMessage {
var msgs []*bgp.BGPMessage
pathByAttrs := make(map[uint32][]*bucket)
-
+ pathLen := len(pathList)
for _, path := range pathList {
y := func(p *Path) bool {
+ // the merging logic makes gobgpd slower so if
+ // paths are not many, let's avoid mering.
+ if pathLen < 1024 {
+ return false
+ }
if p.GetRouteFamily() != bgp.RF_IPv4_UC {
return false
}