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

SmallBank benchmark implementation #45

Merged
merged 32 commits into from
Aug 16, 2021
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d2fc30b
Add sample client_properties.json
supl Aug 2, 2021
db6bc2c
Add contracts of smallbank
supl Aug 2, 2021
7f05b5c
Add script to register contracts for smallbank
supl Aug 2, 2021
463dacf
Create smallbank-loader
supl Aug 3, 2021
0bda6f9
Implement smallbank-bench
supl Aug 4, 2021
03b5888
Revise
supl Aug 4, 2021
0ab37c0
Remove --trace-warning runtime option
supl Aug 4, 2021
5ae9dfb
client_properties.json -> client.properties.json
supl Aug 4, 2021
a1eaa52
Proper name
supl Aug 4, 2021
f85a694
Revise error message
supl Aug 4, 2021
9c1f0b2
Use atomic
supl Aug 4, 2021
ef9b439
Shift 1
supl Aug 4, 2021
97f7e51
BigInt
supl Aug 4, 2021
5e43be8
thread -> concurrency
supl Aug 6, 2021
c7654a3
Revise usage print
supl Aug 6, 2021
34944db
Add README.md
supl Aug 6, 2021
6491897
Revise
supl Aug 11, 2021
e939227
Rename
supl Aug 12, 2021
4659def
Revise smallbank-loader
supl Aug 12, 2021
c7130c4
Executable
supl Aug 12, 2021
946f33b
Remove unused comment
supl Aug 12, 2021
55eaecf
Remove unused pool
supl Aug 12, 2021
d7ff119
Handle working directory
supl Aug 13, 2021
308a15c
Bugfix
supl Aug 13, 2021
63a399c
properties is mandatory without any default value
supl Aug 13, 2021
6cb6467
Ramp up time can be 0
supl Aug 13, 2021
2585851
Use properties-parser package
supl Aug 15, 2021
511d618
Add util to parse Scalar DL client.properties
supl Aug 15, 2021
4a61d2b
Add client.properties
supl Aug 15, 2021
9c7d88a
Use client.properties
supl Aug 15, 2021
44d2987
Revise README.md
supl Aug 15, 2021
ce605ad
Remove client.properties.json
supl Aug 15, 2021
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
Prev Previous commit
Next Next commit
thread -> concurrency
  • Loading branch information
supl committed Aug 6, 2021
commit 5e43be89d8c6c2d904d7e8695cb6a47bdd720fd0
16 changes: 8 additions & 8 deletions benchmark/smallbank-bench
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ const fs = require('fs');
const [
properties,
numberOfAccount,
numberOfThread,
numberOfConcurrency,
duration,
rampUpTime,
operations,
@@ -26,7 +26,7 @@ const fs = require('fs');

const start = Date.now();
let from = start;
for (let i = 0; i < numberOfThread; i++) {
for (let i = 0; i < numberOfConcurrency; i++) {
(async () => {
while (isRunning) {
const [operation, argument] = createExecution(operations, accounts);
@@ -122,7 +122,7 @@ function parseArgv() {
fs.readFileSync('client.properties.json', 'utf8'),
);
let numberOfAccount = 10000;
let numberOfThread = 1;
let numberOfConcurrency = 1;
let duration = 200;
let rampUpTime = 60;
let operations = [
@@ -158,9 +158,9 @@ function parseArgv() {
}
break;

case '--num-threads':
case '--num-concurrencies':
if (argv[i + 1] && !isNaN(argv[i + 1]) && parseInt(argv[i + 1]) > 0) {
numberOfThread = parseInt(argv[i + 1]);
numberOfConcurrency = parseInt(argv[i + 1]);
i++;
} else {
usage();
@@ -208,7 +208,7 @@ function parseArgv() {
return [
properties,
numberOfAccount,
numberOfThread,
numberOfConcurrency,
duration,
rampUpTime,
operations,
@@ -222,7 +222,7 @@ function usage() {
`${path.basename(process.argv[1])} ` +
'[--properties PROPERTIES_FILE, --config PROPERTIES_FILE] ' +
'[--num-accounts NUM_ACCOUNTS] ' +
'[--num-threads NUM_THREADS] ' +
'[--num-concurrencies NUM_CONCURRENCIES] ' +
'[--duration DURATION] ' +
'[--ramp-up-time RAMP_UP_TIME] ' +
'[--operation OPERATION] ' +
@@ -234,7 +234,7 @@ function usage() {
'\t\tA configuration file in properties format.\n' +
'\t--num-accounts NUM_ACCOUNTS\n' +
'\t\tThe number of target accounts.\n' +
'\t--num-threads NUM_THREADS\n' +
'\t--num-concurrencies NUM_CONCURRENCIES\n' +
'\t\tThe number of threads to run.\n' +
'\t--duration DURATION\n' +
'\t\tThe duration of benchmark in seconds\n' +
26 changes: 13 additions & 13 deletions benchmark/smallbank-loader
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@
const {ClientService} = require('../');

(async () => {
const [properties, numberOfAccount, numberOfThread] = parseArgv();
const [properties, numberOfAccount, numberOfConcurrency] = parseArgv();
const clientService = new ClientService(properties);
const accountsList = createAccountListForThread(
numberOfAccount,
numberOfThread,
numberOfConcurrency,
); // [[0, ...], [1, ...], ...]

const promises = accountsList.map((accounts) =>
@@ -25,18 +25,18 @@ function usage() {
`${path.basename(process.argv[1])} ` +
'[--properties PROPERTIES_FILE, --config PROPERTIES_FILE] ' +
'[--num-accounts NUM_ACCOUNTS] ' +
'[--num-threads NUM_THREADS] ' +
'[--num-concurrencies NUM_CONCURRENCIES] ' +
'[-h, --help]',
);
}

function createAccountListForThread(numberOfAccount, numberOfThread) {
if (numberOfThread > numberOfAccount) {
numberOfThread = numberOfAccount;
function createAccountListForThread(numberOfAccount, numberOfConcurrency) {
if (numberOfConcurrency > numberOfAccount) {
numberOfConcurrency = numberOfAccount;
}

const reminder = numberOfAccount % numberOfThread;
const chunkSize = (numberOfAccount - reminder) / numberOfThread;
const reminder = numberOfAccount % numberOfConcurrency;
const chunkSize = (numberOfAccount - reminder) / numberOfConcurrency;

const accountsList = [];
let accounts = [];
@@ -52,7 +52,7 @@ function createAccountListForThread(numberOfAccount, numberOfThread) {
let i = 0;
for (const account of accounts) {
accountsList[i].push(account);
i = i++ % numberOfThread;
i = i++ % numberOfConcurrency;
}

return accountsList; // [[0, ...], [1, ...], ...]
@@ -64,7 +64,7 @@ function parseArgv() {
fs.readFileSync('client.properties.json', 'utf8'),
);
let numberOfAccount = 10000;
let numberOfThread = 1;
let numberOfConcurrency = 1;

const argv = process.argv.slice(2);

@@ -91,9 +91,9 @@ function parseArgv() {
}
break;

case '--num-threads':
case '--num-concurrencies':
if (argv[i + 1] && !isNaN(argv[i + 1]) && parseInt(argv[i + 1]) > 0) {
numberOfThread = parseInt(argv[i + 1]);
numberOfConcurrency = parseInt(argv[i + 1]);
i++;
} else {
usage();
@@ -108,7 +108,7 @@ function parseArgv() {
}
}

return [properties, numberOfAccount, numberOfThread];
return [properties, numberOfAccount, numberOfConcurrency];
}

const created = new Uint32Array(new SharedArrayBuffer(1024));