Commit 325c28b5 authored by Mathieu Giraud's avatar Mathieu Giraud

js/: repair the speed test, using directly `index.html` and `config.speed_test`, removing old files

`test_speed.html` and `dataTest.js` are removed, we rather use working data from `test/QUnit/testFiles/data_test`.
Fixes #2196.
parent c749ce4e
...@@ -51,7 +51,10 @@ function loadAfterConf() { ...@@ -51,7 +51,10 @@ function loadAfterConf() {
"../shortcut", "../shortcut",
"../export", "../export",
"../similarity", "../similarity",
"../tools" "../tools",
// Speed test
"../test",
"../../test/QUnit/testFiles/data_test",
], function(){ ], function(){
if (typeof main == "undefined"){ if (typeof main == "undefined"){
require(["../main"]); require(["../main"]);
......
...@@ -45,4 +45,7 @@ var config = { ...@@ -45,4 +45,7 @@ var config = {
/* /*
"proxy": "https://db.vidjil.org/vidjil/proxy/imgt" "proxy": "https://db.vidjil.org/vidjil/proxy/imgt"
*/ */
/* 4) Debug and test options */
"speed_test": false,
} }
...@@ -91,6 +91,10 @@ try { ...@@ -91,6 +91,10 @@ try {
console.log("=== main.js finished ==="); console.log("=== main.js finished ===");
if (typeof config.speed_test != 'undefined')
if (config.speed_test)
speedTest(m);
var timeout; var timeout;
$(document).ajaxStart(function () { $(document).ajaxStart(function () {
//show ajax indicator //show ajax indicator
......
var DB_ADDRESS = "http://134.206.11.64:8000/Vidjil/";
var CGI_ADDRESS = "http://127.0.1.1/cgi-bin/";
function speedTest(m) {
var startTime = new Date() var startTime = new Date()
.getTime(); .getTime();
var elapsedTime = 0; var elapsedTime = 0;
var m = new Model(); var log = '';
var db = new Database(m);
var graph = new Graph("visu2", m, db);
var list = new List("list", "data", m, db);
var sp = new ScatterPlot("visu", m, db);
var segment = new Segment("bot-container", m, db);
for (var i = 20; i < 101; i = i + 20) { for (var i = 20; i < 101; i = i + 20) {
document.getElementById("test_result")
.innerHTML += "</br> load top " + i + "</br>"; log += "</br> load top " + i + "</br>";
startTime = new Date() startTime = new Date()
.getTime(); .getTime();
elapsedTime = 0; elapsedTime = 0;
m.parseJsonData(dataTest, i)
m.parseJsonData(json_data, i)
.loadGermline(); .loadGermline();
m.initClones() m.initClones()
elapsedTime = new Date() elapsedTime = new Date()
.getTime() - startTime; .getTime() - startTime;
document.getElementById("test_result") log += "init+load time : " + elapsedTime + "ms</br>";
.innerHTML += "init+load time : " + elapsedTime + "ms</br>";
for (var j = 20; j < i + 1; j = j + 20) { for (var j = 20; j < i + 1; j = j + 20) {
m.displayTop(j); m.displayTop(j);
...@@ -42,18 +35,19 @@ for (var i = 20; i < 101; i = i + 20) { ...@@ -42,18 +35,19 @@ for (var i = 20; i < 101; i = i + 20) {
m.update(); m.update();
elapsedTime = new Date() elapsedTime = new Date()
.getTime() - startTime; .getTime() - startTime;
document.getElementById("test_result") log += "complete update time (display :" + j + ") : " + elapsedTime + "ms";
.innerHTML += "complete update time (display :" + j + ") : " + elapsedTime + "ms";
startTime = new Date() startTime = new Date()
.getTime(); .getTime();
elapsedTime = 0; elapsedTime = 0;
m.updateElem([0, 2, 3, 5, 8, 12]); m.updateElem([0, 2, 3]); // , 5, 8, 12]);
elapsedTime = new Date() elapsedTime = new Date()
.getTime() - startTime; .getTime() - startTime;
document.getElementById("test_result") log += " // 5 clones update time (display :" + j + ") : " + elapsedTime + "ms</br>";
.innerHTML += " // 5 clones update time (display :" + j + ") : " + elapsedTime + "ms</br>";
} }
}
console.dataBox(log)
} }
\ No newline at end of file
This diff is collapsed.
<!doctype html>
<!--
This file is part of "Vidjil" <http://bioinfo.lille.inria.fr/vidjil>, V(D)J repertoire browsing and analysis
Copyright (C) 2013, 2014, 2015 by Marc Duez <marc.duez@lifl.fr> and the Vidjil Team
Bonsai bioinformatics at CRIStAL (UMR CNRS 9189, Université Lille) and Inria Lille
"Vidjil" is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
"Vidjil" is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with "Vidjil". If not, see <http://www.gnu.org/licenses/>
-->
<html>
<head>
<meta charset="utf-8">
<title>Vidjil</title>
<meta charset="utf-8">
<title>Vidjil</title>
<link id="palette" rel="stylesheet" type="text/css" href="css/light.css" />
<!--[if lte IE 8]><script src="js/r2d3.js" charset="utf-8"></script><![endif]-->
<!--[if gte IE 9]><!-->
<script type="text/javascript" src='js/lib/d3.v3.js'></script>
<!--<![endif]-->
<script type="text/javascript" src="js/lib/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/lib/jquery.form.js"></script>
<script type="text/javascript" src='js/lib/StackBlur.js'></script>
<script type="text/javascript" src='js/lib/jspdf.js'></script>
<script type="text/javascript" src='js/lib/jspdf.plugin.addimage.js'></script>
<script type="text/javascript" src='js/lib/jspdf.plugin.svgToPdf.js'></script>
<script type="text/javascript" src='js/lib/jspdf.plugin.split_text_to_size.js'></script>
<script type="text/javascript" src='js/lib/jspdf.plugin.standard_fonts_metrics.js'></script>
<script type="text/javascript" src='js/lib/underscore.js'></script>
<script type="text/javascript" src='js/lib/rgbcolor.js'></script>
<script type="text/javascript" src='js/lib/file.js'></script>
<script type="text/javascript" src="js/lib/less-1.5.0.min.js"></script>
<script type="text/javascript" src='js/lib/jquery.zclip.js'></script>
<script type="text/javascript" src='js/view.js'></script>
<script type="text/javascript" src='js/compare.js'></script>
<script type="text/javascript" src='js/germline_builder.js'></script>
<script type="text/javascript" src='js/germline.js'></script>
<script type="text/javascript" src='js/model_loader.js'></script>
<script type="text/javascript" src='js/model.js'></script>
<script type="text/javascript" src='js/clone.js'></script>
<script type="text/javascript" src='js/segmenter.js'></script>
<script type="text/javascript" src='js/list.js'></script>
<script type="text/javascript" src='js/axis.js'></script>
<script type="text/javascript" src="js/graph.js"> </script>
<script type="text/javascript" src="js/scatterPlot.js"> </script>
<script type="text/javascript" src='js/builder.js'></script>
<script type="text/javascript" src='js/vidjil-style.js'></script>
<script type="text/javascript" src='js/crossDomain.js'></script>
<script type="text/javascript" src='js/pdf.js'></script>
<script type="text/javascript" src='js/database.js'></script>
<script type="text/javascript" src='js/conf.js'></script>
<!--
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
-->
</head>
<body >
<!-- MID-CONTAINER -->
<div id="mid-container" onmouseover="hideSelector()">
<!-- LEFT-CONTAINER -->
<div id="left-container">
<div id="info"> </div>
<div id="list"> </div>
</div>
<!-- fin left-container -->
<div id="vertical-separator">
</div>
<!-- RIGHT-CONTAINER -->
<div id="right-container"></div>
<!-- VISU-CONTAINER -->
<div id="visu-container">
<div id="visu2"></div>
<div id="visu-separator" >...</div>
<div id="visu" onclick=""></div>
</div>
</div>
<!-- BOT-CONTAINER / SEGMENTER-CONTAINER -->
<div id="bot-container"> </div>
<div id="tagSelector">
<span class="closeButton" onclick="$('#tagSelector').hide('fast')">X</span>
<div> tag for <span id=tag_name></span><span id=tag_id></span></div>
<ul> </ul>
</div>
<div id="frame-container"></div>
<div id="popup-container">
<span class="closeButton" onclick="closePopupMsg()">X</span>
<div id="popup-msg"></div>
</div>
<div id="data-container">
<span class="closeButton" onclick="closeDataBox()">X</span>
<div id="data-msg"></div>
</div>
<div id="db_div">
<span class="closeButton" onclick="db.close()">X</span>
<div id="db_msg">
</div>
</div>
<form id="form"></form>
<div id="test_result"></div>
</body>
<script type="text/javascript" src='test/dataTest.js'></script>
<script type="text/javascript" src="js/test.js"> </script>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment