text to one div or to few

JavaScript performance comparison

Test case created

Preparation code

<div id="console_input" class="consoleInput">
  <div id="main_console">
  </div>
  <div id="drag_hint">
    Dragging
    <span id="vec_or_line">
    </span>
    from (
    <span id="dr_x_from">
    </span>
    ,
    <span id="dr_y_from">
    </span>
    ) to (
    <span id="dr_x_to">
    </span>
    ,
    <span id="dr_y_to">
    </span>
    )
  </div>
</div>
<script>
Benchmark.prototype.setup = function() {
    function ConsoleController() {
      this.mainConsoleDiv = document.getElementById('main_console');
      this.draggingDiv = document.getElementById('drag_hint');
      this.draggingVecOrLineDiv = document.getElementById('vec_or_line');
      this.draggingFromX = document.getElementById('dr_x_from');
      this.draggingFromY = document.getElementById('dr_y_from');
      this.draggingToX = document.getElementById('dr_x_to');
      this.draggingToY = document.getElementById('dr_y_to');
    }
    var textArea = new ConsoleController();
};
</script>

Preparation code output

Dragging from ( , ) to ( , )

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Text to one div
textArea.mainConsoleDiv.innerHTML = 'Dragging vector from ' + '(' + 12 + ',' + 12 + ')' + ' to: ' + '(' + 12 + ',' + 12 + ')';
pending…
Text to few divs
textArea.draggingToX.innerHTML = 12;
textArea.draggingToY.innerHTML = 12;
textArea.draggingFromX.innerHTML = 12;
textArea.draggingFromY.innerHTML = 12;
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment