-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SC-552 Complexity benchmarks (#3152)
- Loading branch information
Showing
19 changed files
with
1,034 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
benchmark/src/main/scala/com/wavesplatform/state/DBState.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.wavesplatform.state | ||
|
||
import java.io.File | ||
|
||
import com.wavesplatform.Application | ||
import com.wavesplatform.account.AddressScheme | ||
import com.wavesplatform.common.state.ByteStr | ||
import com.wavesplatform.database.{LevelDBWriter, openDB} | ||
import com.wavesplatform.lang.directives.DirectiveSet | ||
import com.wavesplatform.settings.WavesSettings | ||
import com.wavesplatform.transaction.smart.WavesEnvironment | ||
import com.wavesplatform.utils.ScorexLogging | ||
import monix.eval.Coeval | ||
import org.iq80.leveldb.DB | ||
import org.openjdk.jmh.annotations.{Param, Scope, State, TearDown} | ||
|
||
@State(Scope.Benchmark) | ||
abstract class DBState extends ScorexLogging { | ||
@Param(Array("waves.conf")) | ||
var configFile = "" | ||
|
||
lazy val settings: WavesSettings = Application.loadApplicationConfig(Some(new File(configFile)).filter(_.exists())) | ||
|
||
lazy val db: DB = openDB(settings.dbSettings.directory) | ||
|
||
lazy val levelDBWriter: LevelDBWriter = | ||
LevelDBWriter.readOnly( | ||
db, | ||
settings.copy(dbSettings = settings.dbSettings.copy(maxCacheSize = 1)) | ||
) | ||
|
||
AddressScheme.current = new AddressScheme { override val chainId: Byte = 'W' } | ||
|
||
lazy val environment = new WavesEnvironment( | ||
AddressScheme.current.chainId, | ||
Coeval.raiseError(new NotImplementedError("`tx` is not implemented")), | ||
Coeval(levelDBWriter.height), | ||
levelDBWriter, | ||
null, | ||
DirectiveSet.contractDirectiveSet, | ||
ByteStr.empty | ||
) | ||
|
||
@TearDown | ||
def close(): Unit = { | ||
db.close() | ||
} | ||
} |
150 changes: 0 additions & 150 deletions
150
benchmark/src/main/scala/com/wavesplatform/state/ExtractInfo.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.