Status: Accepted
Owner: ----
CC: [email protected]
Labels: Type-Bug Priority-Medium

New issue 3199 by [email protected]: HGraphBuilder exhibits O(n^2) complexity with respect to number of function literals
http://code.google.com/p/v8/issues/detail?id=3199

HGraphBuilder::VisitFunctionLiteral for each literal calls SearchSharedFunctionInfo which iterates relocations again and again from the very beginning. Instead a mapping start_position -> SharedFunctionInfo should be computed.

$ cat test.js
var src = new Array(20000);
for (var i = 0; i < src.length; i++) src[i] = '(function() {})';
var f = new Function("start",
  src.join(';') + ";" +
  "for (var i = 0; i < 100000; i++);" +
  "print((Date.now() - start) + ' ms.');");
f(Date.now());
f(Date.now());
$ out/ia32.release/d8 --trace-opt test.js
...
1 ms.
[optimizing 0x57a6f4b1 <JS Function (SharedFunctionInfo 0x363aa4b5)> - took 3.257, 1.157, 0.430 ms]
3311 ms.


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to