core: reduce mem usage during bench setup, mark long-running tests

This commit is contained in:
Martin Holst Swende 2024-10-25 15:59:37 +02:00
parent 31bb0fbf33
commit 47b4ccb90f
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
2 changed files with 32 additions and 4 deletions

View file

@ -81,9 +81,15 @@ var (
// value-transfer transaction with n bytes of extra data in each
// block.
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) {
toaddr := common.Address{}
data := make([]byte, nbytes)
gas, _ := IntrinsicGas(data, nil, false, false, false, false)
signer := gen.Signer()
gasPrice := big.NewInt(0)
@ -210,9 +216,15 @@ func BenchmarkChainRead_full_10k(b *testing.B) {
benchReadChain(b, true, 10000)
}
func BenchmarkChainRead_header_100k(b *testing.B) {
if testing.Short() {
b.Skip("Skipping in short-mode")
}
benchReadChain(b, false, 100000)
}
func BenchmarkChainRead_full_100k(b *testing.B) {
if testing.Short() {
b.Skip("Skipping in short-mode")
}
benchReadChain(b, true, 100000)
}
func BenchmarkChainRead_header_500k(b *testing.B) {

View file

@ -239,9 +239,25 @@ func BenchmarkPriceHeapOverflow10MB(b *testing.B) { benchmarkPriceHeapOverflow(
func BenchmarkPriceHeapOverflow100MB(b *testing.B) { benchmarkPriceHeapOverflow(b, 100*1024*1024) }
func BenchmarkPriceHeapOverflow1GB(b *testing.B) { benchmarkPriceHeapOverflow(b, 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 BenchmarkPriceHeapOverflow100GB(b *testing.B) { benchmarkPriceHeapOverflow(b, 100*1024*1024*1024) }
func BenchmarkPriceHeapOverflow25GB(b *testing.B) {
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) {
// Calculate how many unique transactions we can fit into the provided disk