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

[TEST] Breaking performance tests #1632

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4a3d796
Fix initial period prediction in multithread mode
peaBerberian Jan 13, 2025
3db0e66
Improve performance tests writing
peaBerberian Jan 14, 2025
10e5a82
Improve performance logs
peaBerberian Jan 14, 2025
6f2185a
Run performance tests on all PR against base branch
peaBerberian Jan 14, 2025
01e5d6a
perf: Try in gh comment
peaBerberian Jan 17, 2025
e5b683c
Perf: Fix typo
peaBerberian Jan 21, 2025
5940dc7
perf: Update output. Also report not significative changes
peaBerberian Jan 21, 2025
5e7e422
perf: Skip if another commit or label
peaBerberian Jan 21, 2025
accdad5
perf: Update slightly perf comment output
peaBerberian Jan 21, 2025
773e28d
perf: Minimal wording update
peaBerberian Jan 21, 2025
b447496
perf: report is under a markdown table format
peaBerberian Jan 21, 2025
e591762
perf: Remove unnecessary newline
peaBerberian Jan 21, 2025
23edde8
perf: Add some newlines in test reports
peaBerberian Jan 21, 2025
459069f
Add delay to break performance tests
peaBerberian Jan 17, 2025
3b6c99d
perf: remove not useful perf percentage
peaBerberian Jan 21, 2025
5073170
rerun
peaBerberian Jan 22, 2025
10d3104
Try reverse
peaBerberian Jan 22, 2025
1cdcc19
Maybe that's the right syntax
peaBerberian Jan 22, 2025
b4ddbc2
wip
peaBerberian Jan 22, 2025
b31f1e8
MAIS NON ON VEUT PAS
peaBerberian Jan 22, 2025
a222cf2
hallelujah
peaBerberian Jan 22, 2025
96c65a6
waitnoitsbrokennow
peaBerberian Jan 22, 2025
643d016
fuck what do you want
peaBerberian Jan 22, 2025
16651b9
and that
peaBerberian Jan 22, 2025
83899f0
retrythatshit
peaBerberian Jan 22, 2025
fac56d0
tell me what you have
peaBerberian Jan 22, 2025
2d5aaaa
that?
peaBerberian Jan 22, 2025
7f94a9f
wip
peaBerberian Jan 22, 2025
9125109
wip
peaBerberian Jan 22, 2025
9ee260b
this
peaBerberian Jan 22, 2025
a7dcc4a
wip
peaBerberian Jan 22, 2025
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
47 changes: 43 additions & 4 deletions .github/workflows/perfs.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,63 @@
name: Performance tests

on:
pull_request:
types: [labeled]
types: [opened, synchronize, reopened]

# Abort if new commit since then
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
perf-tests:
if: ${{ github.event.label.name == 'Performance checks' }}
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-performance-checks') }}
runs-on: [ubuntu-latest]
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
# needed for integration & memory tests codecs support
- run: echo "${{ contains(github.event.pull_request.labels.*.name, 'skip-performance-checks') }}"
- run: echo "${{ contains(github.event.pull_request.labels.*.name, 'totoleheros') }}"
- run: echo "${{ !contains(github.event.pull_request.labels.*.name, 'skip-performance-checks') }}"
- run: echo "${{ !contains(github.event.pull_request.labels.*.name, 'totoleheros') }}"
- run: echo "${{ toJson(github.event.issue.labels) }}"
- run: echo "toto"
- run: echo "${{ toJson(github.event.issue.labels.*.name) }}"

- run:
sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y
ubuntu-restricted-extras
- run: npm ci
- run: export DISPLAY=:99
- run: sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
- run: node tests/performance/run.mjs
- run:
node tests/performance/run.mjs --branch $GITHUB_BASE_REF --remote-git-url
https://github.com/canalplus/rx-player.git --report perf-report.md
- name: Post comment
if: always()
uses: actions/github-script@v7
with:
script: |
const { readFileSync, existsSync } = require('fs');
if (!existsSync("./perf-report.md")) {
return;
}
const fileContent = readFileSync("./perf-report.md").toString();
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
// TODO: generate comment header inside the report file instead of here for better portability?
// We should already have access to the sha1 through `git` and the destination branch through the command line arguments.
body: "Automated performance checks have been performed on commit " +
"\`${{github.event.pull_request.head.sha}}\` with the base branch \`${{github.base_ref}}\`.\n\n" +
fileContent +
"\n\n If you want to skip performance checks for latter commits, add the `skip-performance-checks` label to this Pull Request.",
})
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/demo/worker.js

/tests/performance/node_modules
/tests/performance/bundle1.js
/tests/performance/bundle2.js
/tests/performance/previous.js
/tests/performance/current.js
/tests/performance/package.json
/tests/performance/package-lock.json

Expand Down
2 changes: 1 addition & 1 deletion src/core/main/worker/worker_main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ function loadOrReloadPreparedContent(
);

StreamOrchestrator(
{ initialPeriod: manifest.periods[0], manifest },
{ initialPeriod, manifest },
playbackObserver,
representationEstimator,
segmentSinksStore,
Expand Down
5 changes: 5 additions & 0 deletions src/main_thread/init/media_source_content_initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import isNullOrUndefined from "../../utils/is_null_or_undefined";
import noop from "../../utils/noop";
import objectAssign from "../../utils/object_assign";
import type { IReadOnlySharedReference } from "../../utils/reference";
import sleep from "../../utils/sleep";
import type { ISyncOrAsyncValue } from "../../utils/sync_or_async";
import SyncOrAsync from "../../utils/sync_or_async";
import type { CancellationSignal } from "../../utils/task_canceller";
Expand Down Expand Up @@ -205,6 +206,10 @@ export default class MediaSourceContentInitializer extends ContentInitializer {
);

this._setupInitialMediaSourceAndDecryption(mediaElement)
.then(async (initResult) => {
await sleep(200);
return initResult;
})
.then((initResult) =>
this._onInitialMediaSourceReady(
mediaElement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<script type="text/javascript" src="./bundle1.js" charset="utf-8"></script>
<script type="text/javascript" src="./current.js" charset="utf-8"></script>
<title>RxPlayer - Performance tests</title>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<script type="text/javascript" src="./bundle2.js" charset="utf-8"></script>
<script type="text/javascript" src="./previous.js" charset="utf-8"></script>
<title>RxPlayer - Performance tests</title>
</head>
<body>
Expand Down
Loading
Loading