Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-backend",
"comment": "Add performance test for concurrent query",
"type": "none"
}
],
"packageName": "@itwin/core-backend"
}
2 changes: 1 addition & 1 deletion core/backend/src/test/ecdb/ConcurrentQuery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe("ConcurrentQuery", () => {
expect(resp.stats.cpuTime).to.be.closeTo(1000970, 500000);
expect(resp.stats.totalTime).to.be.closeTo(1001, 100);
expect(resp.stats.memUsed).to.be.closeTo(2, 3);
expect(resp.stats.prepareTime).to.be.closeTo(0, 2);
expect(resp.stats.prepareTime).to.be.closeTo(0, 50);
Comment thread
MichaelSwigerAtBentley marked this conversation as resolved.
Outdated
db.close();
});

Expand Down
4 changes: 2 additions & 2 deletions core/backend/src/test/ecdb/ECDb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe("ECDb", () => {
});
}
const runDbListPragmaCCQ = async (ecdb: ECDb) => {
const reader = ecdb.createQueryReader("PRAGMA db_list");
const reader = ecdb.createQueryReader("PRAGMA db_list", undefined, new QueryOptionsBuilder().setUsePrimaryConnection(true).getOptions());
Comment thread
MichaelSwigerAtBentley marked this conversation as resolved.
Outdated
const result: { alias: string, filename: string, profile: string }[] = [];
while (await reader.step()) {
result.push(reader.current.toRow());
Expand Down Expand Up @@ -164,7 +164,7 @@ describe("ECDb", () => {
alias: "source",
fileName: path.join(outDir, "source_file.ecdb"),
profile: "SQLite"
}
},
]);
testECDb1.detachDb("source");
expect(await runDbListPragmaCCQ(testECDb1)).deep.equals([
Expand Down
2 changes: 1 addition & 1 deletion core/backend/src/test/ecdb/ECSqlStatement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3432,7 +3432,7 @@ describe("ECSqlStatement", () => {
assert.isTrue(Id64.isValidId64(parentHasChildrenClassId));

// When the ECSql insert validation is set to true, the invalid relClassId is detected and an error is thrown.
assert.isTrue(await (ecdb.createQueryReader("PRAGMA validate_ecsql_writes=true")).step());
assert.isTrue(await (ecdb.createQueryReader("PRAGMA validate_ecsql_writes=true", undefined, new QueryOptionsBuilder().setUsePrimaryConnection(true).getOptions())).step());

reader = ecdb.createQueryReader("SELECT ECInstanceId FROM meta.ECClassDef WHERE Name='ParentHasChildren'");
assert.isTrue(await reader.step());
Expand Down
1 change: 1 addition & 0 deletions full-stack-tests/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"perftest:schemaloader": "npm run -s perftest:pre && mocha --timeout=999999999 \"./lib/cjs/perftest/SchemaLoader.test.js\"",
"perftest:ecSqlRowPerformance": "npm run -s perftest:pre && mocha --timeout=999999999 \"./lib/cjs/perftest/ECSqlRow.test.js\"",
"perftest:readQueryPerformance": "npm run -s perftest:pre && mocha --timeout=999999999 \"./lib/cjs/perftest/ReadQueryPerf.test.js\"",
"perftest:ecSqlReaderConcurrent": "npm run -s perftest:pre && mocha --timeout=999999999 \"./lib/cjs/perftest/ECSqlReaderConcurrentPerf.test.js\"",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to run them as part of some pipeline as well? Also, do we want to generate an artifact to record the performance numbers so that we can see how performance number change in future?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It be great to track performance.

"perftest:metadataPerformance": "npm run -s perftest:pre && mocha --timeout=999999999 --grep PerformanceElementGetMetadata \"./lib/cjs/perftest/ElementCRUD.test.js\"",
"perftest:schemaContextPerformance": "npm run -s perftest:pre && mocha --timeout=999999999 \"./lib/cjs/perftest/SchemaContextIModelDb.test.js\"",
"perftest:sqliteChangesetReaderAndChangesetECAdaptorPerformance": "npm run -s perftest:pre && mocha --timeout=999999999 --grep SqliteChangesetReaderAndChangesetECAdaptorAPI \"./lib/cjs/perftest/SQliteChangesetReaderAndChangesetECAdaptor.test.js\"",
Expand Down
Loading
Loading