Add treeinterface benchmarks

```
nCPU: 4, nLeafs: 10000
	asmtree.Add loop:	1m33.393613916s
	asmtree.AddBatch:	480.164271ms
	gravitontree.Add loop:	10.127451689s
	gravitontree.AddBatch:	141.29108ms
	arbo.Add loop:		1.16466211s
	arbo.AddBatch:		97.870759ms

nCPU: 8, nLeafs: 10000
	asmtree.Add loop:	24.538163095s
	asmtree.AddBatch:	194.14454ms
	gravitontree.Add loop:	6.150883978s
	gravitontree.AddBatch:	90.742666ms
	arbo.Add loop:		600.259558ms
	arbo.AddBatch:		50.440291ms

---

nCPU: 4, nLeafs: 500000
	asmtree.AddBatch:	24.95076993s
	gravitontree.AddBatch:	11.768588412s
	arbo.AddBatch:		23.360363426s

nCPU: 8, nLeafs: 500000
	asmtree.Add loop:	(not executed)
	asmtree.AddBatch:	14.363474201s
	gravitontree.Add loop:	8m45.300930089s
	gravitontree.AddBatch:	7.377581508s
	arbo.Add loop:  	2m0.229851504s
	arbo.AddBatch:  	8.759028338s
```
This commit is contained in:
arnaucube
2021-05-19 22:46:46 +02:00
parent aff9bcc186
commit aa0d8728d8
6 changed files with 2266 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ import (
"time"
"github.com/arnaucube/arbo"
"github.com/iden3/go-merkletree/db/pebble"
"github.com/iden3/go-merkletree/db/leveldb"
"go.vocdoni.io/dvote/censustree"
)
@@ -24,11 +24,10 @@ type Tree struct {
func (t *Tree) Init(name, storageDir string) error {
dbDir := filepath.Join(storageDir, "arbotree.db."+strings.TrimSpace(name))
storage, err := pebble.NewPebbleStorage(dbDir, false) // TODO TMP
storage, err := leveldb.NewLevelDbStorage(dbDir, false) // TODO TMP
if err != nil {
return err
}
// storage := memory.NewMemoryStorage()
mt, err := arbo.NewTree(storage, 140, arbo.HashFunctionBlake2b) // TODO here the hash function would depend on the usage
if err != nil {