Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update performance multi contracts #160

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public static void start(String groupId, int count, Integer qps, Boolean enableS
System.out.println("deploy and add 10000 users of SmallBankPrecompiled use DAG...");
SmallBank smallBank =
SmallBank.deploy(client, client.getCryptoSuite().getCryptoKeyPair(), true);
smallBank.setEnableDAG(true);
// add users of smallBank
DagUserInfo dagUserInfo = new DagUserInfo();
IntStream.range(0, 10000)
Expand Down Expand Up @@ -142,10 +143,11 @@ public void onResponse(TransactionReceipt receipt) {
EvidenceSignersData evidenceSignersData =
EvidenceSignersData.deploy(
client, client.getCryptoSuite().getCryptoKeyPair(), evidenceSigners);
System.out.println("load CpuHeavyPrecompiled array length 1k...");

System.out.println("load CpuHeavyPrecompiled array length 100k...");
int arrayLength = 100000;
CpuHeavyPrecompiled cpuHeavy =
CpuHeavyPrecompiled.load(0, client, client.getCryptoSuite().getCryptoKeyPair());
cpuHeavy.setEnableDAG(true);
int contractCount = 4;
if (enableShard) {
shardingService.linkShard("shardWeID", weID.getContractAddress());
Expand Down Expand Up @@ -256,7 +258,7 @@ public void onResponse(TransactionReceipt receipt) {
// cpuHeavy
now = System.currentTimeMillis();
cpuHeavy.sort(
BigInteger.valueOf(1000),
BigInteger.valueOf(arrayLength),
BigInteger.valueOf(index),
new TransactionCallback() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ public static void start(
+ ", groupId: "
+ groupId
+ ", enableParallel: "
+ enableParallel);
+ enableParallel
+ ", sortArraySize: "
+ sortArraySize);

RateLimiter limiter = RateLimiter.create(qps.intValue());

Expand Down