// Generated by CoffeeScript 1.3.1
(function() {

  window.rawtest = function() {
    var a, b, c, data, line, maxval, path, scale1, scale2, temp, x, y, _i, _len, _ref;
    maxval = 6000;
    x = _.range(maxval);
    y = _.range(maxval);
    data = (function() {
      var _i, _len, _ref, _results;
      _ref = _.zip(x, y);
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        temp = _ref[_i];
        _results.push({
          'x': temp[0],
          'y': temp[1]
        });
      }
      return _results;
    })();
    scale1 = d3.scale.linear().domain([0, maxval]).range([0, 300]);
    scale2 = d3.scale.linear().domain([0, maxval]).range([300, 0]);
    $('body').append("<div><svg id='chart'></svg></div>");
    d3.select('#chart').attr('width', 300).attr('height', 300);
    a = new Date();
    _ref = _.range(200);
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      c = _ref[_i];
      line = d3.svg.line().x(function(d) {
        return scale1(d['x']);
      }).y(function(d) {
        return scale2(d['y']);
      });
      path = d3.select('#chart').selectAll('path').data([data]).attr('d', line);
      path = d3.select('#chart').selectAll('path').data([data]);
      path.attr('d', line);
      path.attr('stroke', '#000').attr('fill', 'none');
      path = path.enter().append('path');
      path.attr('d', line);
      path.attr('stroke', '#000').attr('fill', 'none');
    }
    b = new Date();
    return console.log(b - a);
  };

  window.basetest = function() {
    var a, b, c, plotview, renderer, rendererview, _i, _len, _ref;
    window.render = 0;
    plotview = mainview.views[Continuum.Collections['Plot'].models[0].id];
    renderer = Continuum.Collections['LineRenderer'].models[0];
    rendererview = plotview.renderers[renderer.id];
    a = new Date();
    _ref = _.range(200);
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      c = _ref[_i];
      rendererview.render();
    }
    b = new Date();
    return console.log(b - a);
  };

  window.basetest = function() {
    var a, axisview, b, c, plotview, renderer, rendererview, _i, _j, _len, _len1, _ref, _ref1;
    window.render = 0;
    plotview = mainview.views[Continuum.Collections['Plot'].models[0].id];
    renderer = Continuum.Collections['LineRenderer'].models[0];
    rendererview = plotview.renderers[renderer.id];
    a = new Date();
    _ref = _.range(400);
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      c = _ref[_i];
      rendererview.render();
      rendererview.render();
      _ref1 = _.values(plotview.axes);
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        axisview = _ref1[_j];
        axisview.render();
      }
    }
    b = new Date();
    return console.log(b - a);
  };

  window.speedtest = function() {
    var a, b, c, pantoolview, plotview, _i, _len, _ref;
    window.render = 0;
    window.render_axis = 0;
    plotview = mainview.views[Continuum.Collections['Plot'].models[0].id];
    pantoolview = plotview.tools[Continuum.Collections['PanTool'].models[0].id];
    a = new Date();
    _ref = _.range(100);
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      c = _ref[_i];
      pantoolview._drag(1, 1);
      pantoolview._drag(-1, -1);
    }
    b = new Date();
    return console.log(b - a);
  };

}).call(this);
