mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
core: reduce mem usage during bench setup, mark long-running tests
This commit is contained in:
parent
31bb0fbf33
commit
47b4ccb90f
2 changed files with 32 additions and 4 deletions
|
|
@ -81,9 +81,15 @@ var (
|
||||||
// value-transfer transaction with n bytes of extra data in each
|
// value-transfer transaction with n bytes of extra data in each
|
||||||
// block.
|
// block.
|
||||||
func genValueTx(nbytes int) func(int, *BlockGen) {
|
func genValueTx(nbytes int) func(int, *BlockGen) {
|
||||||
|
// We can reuse the data for all transactions.
|
||||||
|
// During signing, the method tx.WithSignature(s, sig)
|
||||||
|
// performs:
|
||||||
|
// cpy := tx.inner.copy()
|
||||||
|
// cpy.setSignatureValues(signer.ChainID(), v, r, s)
|
||||||
|
// After this operation, the data can be reused by the caller.
|
||||||
|
data := make([]byte, nbytes)
|
||||||
return func(i int, gen *BlockGen) {
|
return func(i int, gen *BlockGen) {
|
||||||
toaddr := common.Address{}
|
toaddr := common.Address{}
|
||||||
data := make([]byte, nbytes)
|
|
||||||
gas, _ := IntrinsicGas(data, nil, false, false, false, false)
|
gas, _ := IntrinsicGas(data, nil, false, false, false, false)
|
||||||
signer := gen.Signer()
|
signer := gen.Signer()
|
||||||
gasPrice := big.NewInt(0)
|
gasPrice := big.NewInt(0)
|
||||||
|
|
@ -210,9 +216,15 @@ func BenchmarkChainRead_full_10k(b *testing.B) {
|
||||||
benchReadChain(b, true, 10000)
|
benchReadChain(b, true, 10000)
|
||||||
}
|
}
|
||||||
func BenchmarkChainRead_header_100k(b *testing.B) {
|
func BenchmarkChainRead_header_100k(b *testing.B) {
|
||||||
|
if testing.Short() {
|
||||||
|
b.Skip("Skipping in short-mode")
|
||||||
|
}
|
||||||
benchReadChain(b, false, 100000)
|
benchReadChain(b, false, 100000)
|
||||||
}
|
}
|
||||||
func BenchmarkChainRead_full_100k(b *testing.B) {
|
func BenchmarkChainRead_full_100k(b *testing.B) {
|
||||||
|
if testing.Short() {
|
||||||
|
b.Skip("Skipping in short-mode")
|
||||||
|
}
|
||||||
benchReadChain(b, true, 100000)
|
benchReadChain(b, true, 100000)
|
||||||
}
|
}
|
||||||
func BenchmarkChainRead_header_500k(b *testing.B) {
|
func BenchmarkChainRead_header_500k(b *testing.B) {
|
||||||
|
|
|
||||||
|
|
@ -239,9 +239,25 @@ func BenchmarkPriceHeapOverflow10MB(b *testing.B) { benchmarkPriceHeapOverflow(
|
||||||
func BenchmarkPriceHeapOverflow100MB(b *testing.B) { benchmarkPriceHeapOverflow(b, 100*1024*1024) }
|
func BenchmarkPriceHeapOverflow100MB(b *testing.B) { benchmarkPriceHeapOverflow(b, 100*1024*1024) }
|
||||||
func BenchmarkPriceHeapOverflow1GB(b *testing.B) { benchmarkPriceHeapOverflow(b, 1024*1024*1024) }
|
func BenchmarkPriceHeapOverflow1GB(b *testing.B) { benchmarkPriceHeapOverflow(b, 1024*1024*1024) }
|
||||||
func BenchmarkPriceHeapOverflow10GB(b *testing.B) { benchmarkPriceHeapOverflow(b, 10*1024*1024*1024) }
|
func BenchmarkPriceHeapOverflow10GB(b *testing.B) { benchmarkPriceHeapOverflow(b, 10*1024*1024*1024) }
|
||||||
func BenchmarkPriceHeapOverflow25GB(b *testing.B) { benchmarkPriceHeapOverflow(b, 25*1024*1024*1024) }
|
|
||||||
func BenchmarkPriceHeapOverflow50GB(b *testing.B) { benchmarkPriceHeapOverflow(b, 50*1024*1024*1024) }
|
func BenchmarkPriceHeapOverflow25GB(b *testing.B) {
|
||||||
func BenchmarkPriceHeapOverflow100GB(b *testing.B) { benchmarkPriceHeapOverflow(b, 100*1024*1024*1024) }
|
if testing.Short() {
|
||||||
|
b.Skip("Skipping in short-mode")
|
||||||
|
}
|
||||||
|
benchmarkPriceHeapOverflow(b, 25*1024*1024*1024)
|
||||||
|
}
|
||||||
|
func BenchmarkPriceHeapOverflow50GB(b *testing.B) {
|
||||||
|
if testing.Short() {
|
||||||
|
b.Skip("Skipping in short-mode")
|
||||||
|
}
|
||||||
|
benchmarkPriceHeapOverflow(b, 50*1024*1024*1024)
|
||||||
|
}
|
||||||
|
func BenchmarkPriceHeapOverflow100GB(b *testing.B) {
|
||||||
|
if testing.Short() {
|
||||||
|
b.Skip("Skipping in short-mode")
|
||||||
|
}
|
||||||
|
benchmarkPriceHeapOverflow(b, 100*1024*1024*1024)
|
||||||
|
}
|
||||||
|
|
||||||
func benchmarkPriceHeapOverflow(b *testing.B, datacap uint64) {
|
func benchmarkPriceHeapOverflow(b *testing.B, datacap uint64) {
|
||||||
// Calculate how many unique transactions we can fit into the provided disk
|
// Calculate how many unique transactions we can fit into the provided disk
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue