Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
fix txAmounts
Browse files Browse the repository at this point in the history
  • Loading branch information
musalbas committed Apr 24, 2019
1 parent 7d0ed18 commit 5d8e253
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cmd/lazyledger_measurements_1/main.go
Expand Up @@ -10,7 +10,7 @@ import (
const namespaceSize = 8

func main() {
txAmounts := []int{128, 256, 384, 512, 640, 1024}
txAmounts := []int{128, 256, 384, 512, 640, 768, 896, 1024}
txSize := 128
for _, txes := range txAmounts {
sb := generateSimpleBlock(txes, txSize)
Expand Down
51 changes: 31 additions & 20 deletions cmd/lazyledger_measurements_2/main.go
Expand Up @@ -13,32 +13,43 @@ const namespaceSize = 8

func main() {
currencyTxes := 10
txAmounts := []int{128, 256, 384, 512, 640, 1024}
txAmounts := []int{128, 256, 384, 512, 640, 768, 896, 1024}
txSize := 256
for _, txes := range txAmounts {
sb, ns := generateSimpleBlock(currencyTxes, txes, txSize)
_, _, proofs1, messages1, _ := sb.ApplicationProof(ns)
sbBandwidth := 0
for _, msg := range *messages1 {
sbBandwidth += len(msg.Marshal())
}
for _, hash := range proofs1 {
sbBandwidth += len(hash)
}
sbBandwidthMax := 0
pbBandwidthMax := 0

for i := 0; i < 10; i++ {
sb, ns := generateSimpleBlock(currencyTxes, txes, txSize)
_, _, proofs1, messages1, _ := sb.ApplicationProof(ns)
sbBandwidth := 0
for _, msg := range *messages1 {
sbBandwidth += len(msg.Marshal())
}
for _, hash := range proofs1 {
sbBandwidth += len(hash)
}
if sbBandwidth > sbBandwidthMax {
sbBandwidthMax = sbBandwidth
}

pb, ns := generateProbabilisticBlock(currencyTxes, txes, txSize)
_, _, proofs2, messages2, _ := pb.ApplicationProof(ns)
pbBandwidth := 0
for _, msg := range *messages2 {
pbBandwidth += len(msg.Marshal())
}
for _, proof := range proofs2 {
for _, hash := range proof {
pbBandwidth += len(hash)
pb, ns := generateProbabilisticBlock(currencyTxes, txes, txSize)
_, _, proofs2, messages2, _ := pb.ApplicationProof(ns)
pbBandwidth := 0
for _, msg := range *messages2 {
pbBandwidth += len(msg.Marshal())
}
for _, proof := range proofs2 {
for _, hash := range proof {
pbBandwidth += len(hash)
}
}
if pbBandwidth > pbBandwidthMax {
pbBandwidthMax = pbBandwidth
}
}

fmt.Println(txes, sbBandwidth, pbBandwidth)
fmt.Println(txes, sbBandwidthMax, pbBandwidthMax)
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/lazyledger_measurements_3/main.go
Expand Up @@ -13,7 +13,7 @@ const namespaceSize = 8

func main() {
currencyTxes := 10
txAmounts := []int{128, 256, 384, 512, 640, 1024}
txAmounts := []int{128, 256, 384, 512, 640, 768, 896, 1024}
txSize := 1024
for _, txes := range txAmounts {
_, c, d := generateSimpleBlock(currencyTxes, txes, txSize)
Expand Down

0 comments on commit 5d8e253

Please sign in to comment.