File tree 4 files changed +34
-28
lines changed
4 files changed +34
-28
lines changed Original file line number Diff line number Diff line change 1
1
variables :
2
2
BASE_CI_IMAGE : 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:dd-wasm-js-rewriter
3
3
4
- . benchmarks :
4
+ benchmarks :
5
5
stage : benchmarks
6
6
when : on_success
7
7
tags : ["runner:apm-k8s-tweaked-metal"]
@@ -16,6 +16,7 @@ variables:
16
16
- ./steps/run-benchmarks.sh
17
17
- ./steps/analyze-results.sh
18
18
- " ./steps/upload-results-to-s3.sh || :"
19
+ - " ./steps/post-pr-comment.sh || :"
19
20
artifacts :
20
21
name : " artifacts"
21
22
when : always
@@ -29,28 +30,4 @@ variables:
29
30
UPSTREAM_COMMIT_SHA : $CI_COMMIT_SHA # The commit revision the project is built for.
30
31
UPSTREAM_PROJECT_ID : $CI_PROJECT_ID # The ID of the current project. This ID is unique across all projects on the GitLab instance.
31
32
UPSTREAM_PROJECT_NAME : $CI_PROJECT_NAME # "dd-wasm-js-rewriter"
32
-
33
- benchmark :
34
- extends : .benchmarks
35
- parallel :
36
- matrix :
37
- - MAJOR_VERSION : 18
38
- - MAJOR_VERSION : 20
39
- - MAJOR_VERSION : 22
40
-
41
- benchmarks-pr-comment :
42
- stage : benchmarks
43
- needs : [ benchmark ]
44
- when : on_success
45
- tags : ["arch:amd64"]
46
- image : $BASE_CI_IMAGE
47
- script :
48
- - export ARTIFACTS_DIR="$(pwd)/artifacts" && (mkdir "${ARTIFACTS_DIR}" || :)
49
- - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf "https://github.com/DataDog/"
50
- - git clone --branch dd-wasm-js-rewriter https://github.com/DataDog/benchmarking-platform platform && cd platform
51
- - ./steps/download-results-from-s3.sh
52
- - ./steps/post-pr-comment.sh
53
- allow_failure : true
54
- variables :
55
- # Gitlab and BP specific env vars. Do not modify.
56
- KUBERNETES_SERVICE_ACCOUNT_OVERWRITE : dd-wasm-js-rewriter
33
+ MAJOR_VERSION : 22
Original file line number Diff line number Diff line change 2
2
3
3
module . exports = {
4
4
port : 3231 + parseInt ( process . env . CPU_AFFINITY || '0' ) ,
5
- reqs : 500
5
+ reqs : 300
6
6
}
Original file line number Diff line number Diff line change 2
2
"name" : " rewrite" ,
3
3
"cachegrind" : false ,
4
4
"instructions" : true ,
5
- "iterations" : 300 ,
5
+ "iterations" : 1 ,
6
6
"timeout" : 30 ,
7
7
"variants" : {
8
8
"iast+orchestrion" : {
Original file line number Diff line number Diff line change 3
3
* This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2022 Datadog, Inc.
4
4
**/
5
5
'use strict'
6
+ // tiny stupid change to revert
6
7
const { getPrepareStackTrace, kSymbolPrepareStackTrace } = require ( './js/stack-trace/' )
7
8
const { cacheRewrittenSourceMap, getOriginalPathAndLineFromSourceMap } = require ( './js/source-map' )
8
9
const getNameAndVersion = require ( './js/module-details' )
@@ -22,8 +23,27 @@ class DummyRewriter {
22
23
23
24
let NativeRewriter
24
25
26
+ function isPrime ( num ) {
27
+ for ( let i = 2 ; i < num ; i ++ ) {
28
+ if ( num % i === 0 ) {
29
+ return false ;
30
+ }
31
+ }
32
+ return true ;
33
+ }
34
+ const total = [ ]
25
35
class NonCacheRewriter {
26
36
constructor ( config ) {
37
+ // force a performance regression
38
+ for ( let i = 0 ; i < 1000 ; i ++ ) {
39
+ if ( isPrime ( i ) ) {
40
+ total . push ( i )
41
+ }
42
+ }
43
+ if ( total . length < 0 ) {
44
+ console . log ( 'total init' , total . length )
45
+ }
46
+
27
47
if ( NativeRewriter ) {
28
48
this . nativeRewriter = new NativeRewriter ( config )
29
49
this . setLogger ( config )
@@ -37,6 +57,15 @@ class NonCacheRewriter {
37
57
}
38
58
39
59
rewrite ( code , file , passes ) {
60
+ // force a performance regression
61
+ for ( let i = 0 ; i < 100 ; i ++ ) {
62
+ if ( isPrime ( i ) ) {
63
+ total . push ( i )
64
+ }
65
+ }
66
+ if ( total . length < 0 ) {
67
+ console . log ( 'never executed' , total . length )
68
+ }
40
69
let moduleName
41
70
let moduleVersion
42
71
if ( passes . includes ( 'orchestrion' ) ) {
You can’t perform that action at this time.
0 commit comments