fix(javascript): trace wrapped Electron IPC paths in large bundles (#1874)
Co-authored-by: David <17119984+fengdwx@users.noreply.github.com>
This commit is contained in:
1 parent
d93fbda390
commit
87b9793c53
46 files changed
+3213
-355
No files matched your search
@@ -37,6 +37,14 @@ export const estimateJavaScriptStaticApplicationProjection = (
|
||||
}
|
||||
for (const binding of facts.electron.native_addon_bindings)
|
||||
records += binding.members.length * 3;
|
||||
for (const path of facts.electron.call_paths ?? []) {
|
||||
// One contextual node and edge per step, with repeated guards and identity.
|
||||
records += path.steps.length * 4 + 8;
|
||||
repeatedBytes +=
|
||||
Buffer.byteLength(JSON.stringify(path.conditions)) *
|
||||
path.steps.length *
|
||||
2;
|
||||
}
|
||||
const metadataBytes = 2048 + Buffer.byteLength(sourcePath) * 4;
|
||||
return (checkpointBytes * 4 + repeatedBytes + records * metadataBytes) * 8;
|
||||
};
|
||||
Reference in new issue
Block a user