| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -438,10 +438,9 @@ The `cpu-prof` module provides utilities related to CPU profiling tests. | |||
| 438 | 438 | ||
| 439 | 439 | ### env | |
| 440 | 440 | ||
| 441 | - * Default: { ...process.env, FIB, NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' } | ||
| 441 | + * Default: { ...process.env, NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' } | ||
| 442 | 442 | ||
| 443 | - Environment variables used in profiled processes. FIB will be set to `40` on | ||
| 444 | - Windows and `30` elsewhere. | ||
| 443 | + Environment variables used in profiled processes. | ||
| 445 | 444 | ||
| 446 | 445 | ### getCpuProfiles(dir) | |
| 447 | 446 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | 'use strict'; | |
| 4 | 4 | ||
| 5 | - const common = require('./'); | ||
| 5 | + require('./'); | ||
| 6 | 6 | const fs = require('fs'); | |
| 7 | 7 | const path = require('path'); | |
| 8 | 8 | const assert = require('assert'); | |
@@ -34,23 +34,12 @@ function verifyFrames(output, file, suffix) { | |||
| 34 | 34 | assert.notDeepStrictEqual(frames, []); | |
| 35 | 35 | } | |
| 36 | 36 | ||
| 37 | - let FIB = 30; | ||
| 38 | - // This is based on emperial values - in the CI, on Windows the program | ||
| 39 | - // tend to finish too fast then we won't be able to see the profiled script | ||
| 40 | - // in the samples, so we need to bump the values a bit. On slower platforms | ||
| 41 | - // like the Pis it could take more time to complete, we need to use a | ||
| 42 | - // smaller value so the test would not time out. | ||
| 43 | - if (common.isWindows) { | ||
| 44 | - FIB = 40; | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | 37 | // We need to set --cpu-interval to a smaller value to make sure we can | |
| 48 | 38 | // find our workload in the samples. 50us should be a small enough sampling | |
| 49 | 39 | // interval for this. | |
| 50 | 40 | const kCpuProfInterval = 50; | |
| 51 | 41 | const env = { | |
| 52 | 42 | ...process.env, | |
| 53 | - FIB, | ||
| 54 | 43 | NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' | |
| 55 | 44 | }; | |
| 56 | 45 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,5 +4,12 @@ function fib(n) { | |||
| 4 | 4 | return fib(n - 1) + fib(n - 2); | |
| 5 | 5 | } | |
| 6 | 6 | ||
| 7 | - const n = parseInt(process.env.FIB) || 35; | ||
| 7 | + // This is based on emperial values - in the CI, on Windows the program | ||
| 8 | + // tend to finish too fast then we won't be able to see the profiled script | ||
| 9 | + // in the samples, so we need to bump the values a bit. On slower platforms | ||
| 10 | + // like the Pis it could take more time to complete, we need to use a | ||
| 11 | + // smaller value so the test would not time out. | ||
| 12 | + const FIB = process.platform === 'win32' ? 40 : 30; | ||
| 13 | + | ||
| 14 | + const n = parseInt(process.env.FIB) || FIB; | ||
| 8 | 15 | process.stdout.write(`${fib(n)}\n`); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments