Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Schema Registry Avro] Add a serialize performance test (#21057)
### Packages impacted by this PR @azure/schema-registry-avro ### Issues associated with this PR Related to #16983 ### Describe the problem that is addressed by this PR Lack of performance tests of the avro serializer ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? There're many potential perf tests but I went with one that uses a single schema and serializes an array. Here is a sample output: ``` > @azure-tests/[email protected] perf-test:node > ts-node test/index.spec.ts "SerializeTest" "--warmup" "1" "--iterations" "10" "--parallel" "100" "--duration" "15" === Starting the perf test === === Creating 100 instance(s) of SerializeTest === === Versions === @azure-tests/[email protected] /home/dealmaha/schemaregistry/sdk/schemaregistry/perf-tests/schema-registry-avro ├── @azure/[email protected] -> ./../../../../common/temp/node_modules/.pnpm/@Azure[email protected]/node_modules/@azure/identity ├── @azure/[email protected] -> ./../../schema-registry-avro ├── @azure/[email protected] -> ./../../schema-registry ├── @azure/[email protected] -> ./../../../test-utils/perf === Parsed options === ┌──────────────────────────────┬──────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────┬────────────────────────────────┬──────────────┬───────────┐ │ (index) │ required │ description │ shortName │ longName │ defaultValue │ value │ ├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────┼────────────────────────────────┼──────────────┼───────────┤ │ items-count │ false │ 'Number of array items' │ 'n' │ 'items-count' │ 1000 │ 1000 │ │ help │ │ 'Shows all of the available options' │ 'h' │ 'help' │ │ undefined │ │ parallel │ │ 'How many of the same test to call at the same time' │ 'p' │ 'parallel' │ 1 │ 100 │ │ duration │ │ 'When to stop calling tests at all' │ 'd' │ 'duration' │ 10 │ 15 │ │ warmup │ │ 'Duration of warmup in seconds' │ 'w' │ 'warmup' │ 5 │ 1 │ │ iterations │ │ 'Times to repeat the whole process, after warmup' │ 'i' │ 'iterations' │ 1 │ 10 │ │ no-cleanup │ │ 'Disables test cleanup' │ │ 'no-cleanup' │ │ undefined │ │ test-proxies │ │ "URIs of TestProxy servers (separated by ';')" │ │ 'test-proxies' │ undefined │ undefined │ │ insecure │ │ 'Applied when test-proxies option is defined, connects with https(insecurely by disabling SSL validation)' │ 'ins' │ 'insecure' │ false │ false │ │ milliseconds-to-log │ │ 'Log frequency in milliseconds' │ 'mtl' │ 'milliseconds-to-log' │ 1000 │ 1000 │ │ list-transitive-dependencies │ │ 'List all dependencies, instead of only direct ones, before test run' │ 'ltd' │ 'list-transitive-dependencies' │ false │ false │ └──────────────────────────────┴──────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────┴────────────────────────────────┴──────────────┴───────────┘ === Calling globalSetup() once for (all) the instance(s) of SerializeTest === === warmup mode, iteration 1. Logs every 1s === ElapsedTime Current Total Average 00:01 1554 1554 1553.98 00:02 2 1556 1555.19 00:03 63 1619 1584.07 === warmup mode, results of iteration 1 === Completed 1,653 operations in a weighted-average of 1.04s (1,595.11 ops/s, 0.001 s/op) === test mode, iteration 1. Logs every 1s === ElapsedTime Current Total Average === test mode, results of iteration 1 === Completed 675,200 operations in a weighted-average of 15.00s (45,017.53 ops/s, 0.000 s/op) === test mode, iteration 2. Logs every 1s === ElapsedTime Current Total Average === test mode, results of iteration 2 === Completed 795,700 operations in a weighted-average of 15.00s (53,045.42 ops/s, 0.000 s/op) === test mode, iteration 3. Logs every 1s === ElapsedTime Current Total Average === test mode, results of iteration 3 === Completed 634,300 operations in a weighted-average of 15.01s (42,272.47 ops/s, 0.000 s/op) === test mode, iteration 4. Logs every 1s === ElapsedTime Current Total Average === test mode, results of iteration 4 === Completed 566,500 operations in a weighted-average of 15.00s (37,763.46 ops/s, 0.000 s/op) === test mode, iteration 5. Logs every 1s === ElapsedTime Current Total Average === test mode, results of iteration 5 === Completed 321,300 operations in a weighted-average of 15.00s (21,419.22 ops/s, 0.000 s/op) === test mode, iteration 6. Logs every 1s === ElapsedTime Current Total Average === test mode, results of iteration 6 === Completed 387,400 operations in a weighted-average of 15.01s (25,813.16 ops/s, 0.000 s/op) === test mode, iteration 7. Logs every 1s === ElapsedTime Current Total Average === test mode, results of iteration 7 === Completed 389,300 operations in a weighted-average of 15.00s (25,951.76 ops/s, 0.000 s/op) === test mode, iteration 8. Logs every 1s === ElapsedTime Current Total Average === test mode, results of iteration 8 === Completed 597,700 operations in a weighted-average of 15.00s (39,846.31 ops/s, 0.000 s/op) === test mode, iteration 9. Logs every 1s === ElapsedTime Current Total Average === test mode, results of iteration 9 === Completed 608,800 operations in a weighted-average of 15.00s (40,584.65 ops/s, 0.000 s/op) === test mode, iteration 10. Logs every 1s === ElapsedTime Current Total Average === test mode, results of iteration 10 === Completed 580,200 operations in a weighted-average of 15.00s (38,677.77 ops/s, 0.000 s/op) ``` ### Are there test cases added in this PR? _(If not, why?)_ Yes ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [x] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary)
- Loading branch information