Hello. I was looking for bottlenecks in my svelte.kit project. The project uses esm modules by default.
And I was confused that all my source code was marked as Node JS.
Expected Behavior
With esm module code have to be marked as { type: appName, category: 'app'}
Current Behavior
Now when I use esm modules my code marked as core.
# /analysis/frame-node.js
# at function getCoreOrV8Type
getCoreOrV8Type (name, systemInfo) {
// TODO: see if any subdivisions of core are useful
const core = { type: 'core', category: 'core' }
let type
if (/\[CODE:RegExp]$/.test(name)) {
type = 'regexp'
} else if (!/(\.m?js)|(node:\w)/.test(name)) {
if (/\[CODE:.*?]$/.test(name) || /v8::internal::.*\[CPP]$/.test(name)) {
type = 'v8'
} else /* istanbul ignore next */ if (/\.$/.test(name)) {
return core
} else if (/\[CPP]$/.test(name) || /\[SHARED_LIB]$/.test(name)) {
type = 'cpp'
} else if (/\[eval]/.test(name)) {
// unless we create an eval checkbox
// "native" is the next best label since
// you cannot tell where the eval comes
// from (app, deps, core)
type = 'native'
} else {
type = 'v8'
}
} else if (/ native /.test(name)) {
type = 'native'
} else if (this.isNodeCore(systemInfo)) { # <------------------------------ here is bug
return core
}
return type
? { type, category: 'all-v8' }
: null
}
Steps to Reproduce (for bugs)
Just try node-clinic-flame-demo with "type":"module" and import some function.
Hello. I was looking for bottlenecks in my svelte.kit project. The project uses esm modules by default. And I was confused that all my source code was marked as Node JS.
Expected Behavior
With esm module code have to be marked as
{ type: appName, category: 'app'}
Current Behavior
Now when I use esm modules my code marked as
core
.Steps to Reproduce (for bugs)
Just try
node-clinic-flame-demo
with"type":"module"
and import some function.Sample upload
Environment
Clinic.js version: v12.1.0
Flame version: v12.1.0 (0x v5.5.0)
Node.js version: v16.19.1