mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 16:40:19 +00:00

This commit improves module loading performance by at least ~25-35% in the module-loader benchmarks. Some optimization strategies include: * Try-finally/try-catch isolation * Replacing regular expressions with manual parsing * Avoiding unnecessary string and array creation * Avoiding constant recompilation of anonymous functions and function definitions within functions PR-URL: https://github.com/nodejs/node/pull/5172 Reviewed-By: James M Snell <jasnell@gmail.com>
17 lines
532 B
Plaintext
17 lines
532 B
Plaintext
before
|
|
|
|
evalmachine.<anonymous>:1
|
|
foo.bar = 5;
|
|
^
|
|
ReferenceError: foo is not defined
|
|
at evalmachine.<anonymous>:1:1
|
|
at ContextifyScript.Script.runInNewContext (vm.js:*)
|
|
at Object.exports.runInNewContext (vm.js:*)
|
|
at Object.<anonymous> (*test*message*undefined_reference_in_new_context.js:*)
|
|
at Module._compile (module.js:*)
|
|
at *..js (module.js:*)
|
|
at Module.load (module.js:*)
|
|
at tryModuleLoad (module.js:*:*)
|
|
at Function.Module._load (module.js:*:*)
|
|
at Function.Module.runMain (module.js:*:*)
|