Skip to content

Commit

Permalink
Better code
Browse files Browse the repository at this point in the history
  • Loading branch information
xrtm000 committed Sep 26, 2023
1 parent 792890b commit 8bea265
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.wavesplatform.lang.v1

import com.wavesplatform.common.utils.EitherExt2
import com.wavesplatform.lang.Common
import com.wavesplatform.lang.directives.values.V8
import com.wavesplatform.lang.directives.values.StdLibVersion
import com.wavesplatform.lang.v1.FunctionHeader.Native
import com.wavesplatform.lang.v1.compiler.Terms.*
import com.wavesplatform.lang.v1.evaluator.FunctionIds.REPLACE_BY_INDEX_OF_LIST
Expand Down Expand Up @@ -35,7 +35,11 @@ class ListReplaceByIndexBenchmark {

@State(Scope.Benchmark)
class ListReplaceByIndexSt {
val ctx = PureContext.build(V8, useNewPowPrecision = true).withEnvironment[Environment].evaluationContext(Common.emptyBlockchainEnvironment())
val ctx =
PureContext
.build(StdLibVersion.VersionDic.all.max, useNewPowPrecision = true)
.withEnvironment[Environment]
.evaluationContext(Common.emptyBlockchainEnvironment())

val list = ARR(Vector.fill(1000)(CONST_LONG(Long.MaxValue)), limited = true).explicitGet()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import cats.implicits.catsSyntaxSemigroup
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.common.utils.{Base58, EitherExt2}
import com.wavesplatform.crypto.Curve25519
import com.wavesplatform.lang.directives.values.V8
import com.wavesplatform.lang.directives.values.StdLibVersion
import com.wavesplatform.lang.v1.EnvironmentFunctionsBenchmark.{curve25519, randomBytes}
import com.wavesplatform.lang.v1.FunctionHeader.Native
import com.wavesplatform.lang.v1.ScriptEvaluatorBenchmark.*
Expand All @@ -22,8 +22,9 @@ import scala.concurrent.duration.SECONDS
import scala.util.Random

object ScriptEvaluatorBenchmark {
val lastVersion = StdLibVersion.VersionDic.all.max
val context =
(PureContext.build(V8, useNewPowPrecision = true) |+| CryptoContext.build(Global, V8))
(PureContext.build(lastVersion, useNewPowPrecision = true) |+| CryptoContext.build(Global, lastVersion))
.withEnvironment[Environment]
.evaluationContext(Common.emptyBlockchainEnvironment())
}
Expand Down

0 comments on commit 8bea265

Please sign in to comment.