eth/filters: added benchmark

This commit is contained in:
Jeffrey Wilcke
2015-10-12 17:54:59 +02:00
parent cefe5c80b1
commit 30f057aaf9
3 changed files with 100 additions and 7 deletions

View File

@ -17,8 +17,6 @@
package filters
import (
"math"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
@ -107,8 +105,6 @@ done:
break done
case block.NumberU64() < earliestBlockNo:
break done
case self.max <= len(logs):
break done
}
// Use bloom filtering to see if this block is interesting given the
@ -128,9 +124,7 @@ done:
block = core.GetBlock(self.db, block.ParentHash())
}
skip := int(math.Min(float64(len(logs)), float64(self.skip)))
return logs[skip:]
return logs
}
func includes(addresses []common.Address, a common.Address) bool {