mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-30 13:11:38 +00:00
Tweak channel for performance test
This commit is contained in:
@ -11,11 +11,11 @@ func BenchmarkSomething(b *testing.B) {
|
|||||||
numChecks := 100000
|
numChecks := 100000
|
||||||
keys := make([]string, numItems)
|
keys := make([]string, numItems)
|
||||||
for i := 0; i < numItems; i++ {
|
for i := 0; i < numItems; i++ {
|
||||||
keys[i] = RandStr(32)
|
keys[i] = RandStr(100)
|
||||||
}
|
}
|
||||||
txs := make([]string, numChecks)
|
txs := make([]string, numChecks)
|
||||||
for i := 0; i < numChecks; i++ {
|
for i := 0; i < numChecks; i++ {
|
||||||
txs[i] = RandStr(32)
|
txs[i] = RandStr(100)
|
||||||
}
|
}
|
||||||
b.StartTimer()
|
b.StartTimer()
|
||||||
|
|
||||||
@ -30,10 +30,5 @@ func BenchmarkSomething(b *testing.B) {
|
|||||||
counter++
|
counter++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, tx := range txs {
|
|
||||||
if _, ok := foo[tx]; ok {
|
|
||||||
counter++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,15 +40,16 @@ func main() {
|
|||||||
//txBytes := hex.EncodeToString(buf[:n])
|
//txBytes := hex.EncodeToString(buf[:n])
|
||||||
request := rpctypes.NewRPCRequest("fakeid", "broadcast_tx", Arr(buf[:8]))
|
request := rpctypes.NewRPCRequest("fakeid", "broadcast_tx", Arr(buf[:8]))
|
||||||
reqBytes := wire.JSONBytes(request)
|
reqBytes := wire.JSONBytes(request)
|
||||||
fmt.Println("!!", string(reqBytes))
|
//fmt.Println("!!", string(reqBytes))
|
||||||
|
fmt.Print(".")
|
||||||
err := ws.WriteMessage(websocket.TextMessage, reqBytes)
|
err := ws.WriteMessage(websocket.TextMessage, reqBytes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Exit(err.Error())
|
Exit(err.Error())
|
||||||
}
|
}
|
||||||
if i%100 == 0 {
|
if i%1000 == 0 {
|
||||||
fmt.Println(i)
|
fmt.Println(i)
|
||||||
}
|
}
|
||||||
time.Sleep(time.Millisecond * 10)
|
time.Sleep(time.Microsecond * 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
ws.Stop()
|
ws.Stop()
|
||||||
|
@ -86,14 +86,16 @@ func (conR *ConsensusReactor) GetChannels() []*p2p.ChannelDescriptor {
|
|||||||
SendQueueCapacity: 100,
|
SendQueueCapacity: 100,
|
||||||
},
|
},
|
||||||
&p2p.ChannelDescriptor{
|
&p2p.ChannelDescriptor{
|
||||||
ID: DataChannel,
|
ID: DataChannel,
|
||||||
Priority: 5,
|
Priority: 2,
|
||||||
SendQueueCapacity: 2,
|
SendQueueCapacity: 50,
|
||||||
|
RecvBufferCapacity: 50 * 4096,
|
||||||
},
|
},
|
||||||
&p2p.ChannelDescriptor{
|
&p2p.ChannelDescriptor{
|
||||||
ID: VoteChannel,
|
ID: VoteChannel,
|
||||||
Priority: 5,
|
Priority: 5,
|
||||||
SendQueueCapacity: 40,
|
SendQueueCapacity: 100,
|
||||||
|
RecvBufferCapacity: 100 * 100,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user