Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: PerformanceTests/DOM/textarea-dom.html

Issue 1355013002: Speed up updating inner value of HTMLTextFormControlElements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: adjust textarea-dom to work over varying strings Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <body> 2 <body>
3 <style> 3 <style>
4 textarea:valid { 4 textarea:valid {
5 background-color: lime; 5 background-color: lime;
6 } 6 }
7 textarea:invalid { 7 textarea:invalid {
8 background-color: red; 8 background-color: red;
9 } 9 }
10 </style> 10 </style>
11 <script src="../resources/runner.js"></script> 11 <script src="../resources/runner.js"></script>
12 <textarea maxlength=2147483647 id="container"></textarea> 12 <textarea maxlength=2147483647 id="container"></textarea>
13 <script> 13 <script>
14 var container = document.getElementById('container'); 14 var container = document.getElementById('container');
15 var nodes = []; 15 var nodes = [];
16 var childCount = 1000; 16 var childCount = 1000;
17 // Vary the text nodes added, avoiding any secondary effects of using identical strings and reusing its allocation.
17 for (var i = 0; i < childCount; ++i) 18 for (var i = 0; i < childCount; ++i)
18 nodes.push(document.createTextNode('A quick brown fox jumps over the lazy do g.\n')); 19 nodes.push(document.createTextNode('A quick brown fox jumps over the ' + i + 'th lazy dog.\n'));
tkent 2015/09/24 03:16:40 Please land this separately.
sof 2015/09/25 08:51:35 Done + adjusted description accordingly.
19 20
20 PerfTestRunner.measureRunsPerSecond({ 21 PerfTestRunner.measureRunsPerSecond({
21 description: "Measures performance of adding text nodes to a textarea, then clearing it.", 22 description: "Measures performance of adding text nodes to a textarea, then clearing it.",
22 run: function() { 23 run: function() {
23 for (var i = 0; i < childCount; ++i) 24 for (var i = 0; i < childCount; ++i)
24 container.appendChild(nodes[i]); 25 container.appendChild(nodes[i]);
25 container.innerHTML = ''; 26 container.innerHTML = '';
26 } 27 }
27 }); 28 });
28 </script> 29 </script>
29 </body> 30 </body>
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698