Repository: couchdb Updated Branches: refs/heads/master 6306428ac -> cf3b48e47
Remove leftovers from broken becnhmark While I tried to land COUCHDB-1432 on 1..x.x it turned out that /benches/run is broken in several places for a longer time and nobody noticed: When trying to fix it (adding a file called test_setup.js) to the template, we will get the next error. As nobody noticed that it is broken for a longer time it seems we currently have no need for benchmarks, and if we have that need, we should add new ones which reflect our current needs and are compatible with 2.0 too. This removes the leftovers of the benchmark which is also broken on 1.6.x for a longer, unknown time which was already deleted in parts for 2.0 Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/cf3b48e4 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/cf3b48e4 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/cf3b48e4 Branch: refs/heads/master Commit: cf3b48e47f03dfb307b1139d2751a3580c6532c8 Parents: 6306428 Author: Robert Kowalski <[email protected]> Authored: Sat Nov 8 13:34:43 2014 +0100 Committer: Robert Kowalski <[email protected]> Committed: Tue Nov 11 11:31:46 2014 +0100 ---------------------------------------------------------------------- license.skip | 2 - test/bench/bench_marks.js | 103 ----------------------------------------- test/bench/run.tpl | 28 ----------- 3 files changed, 133 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/cf3b48e4/license.skip ---------------------------------------------------------------------- diff --git a/license.skip b/license.skip index 9c1d6ac..55adcd8 100644 --- a/license.skip +++ b/license.skip @@ -189,8 +189,6 @@ ^stamp-h1 ^test/Makefile ^test/Makefile.in -^test/bench/Makefile -^test/bench/Makefile.in ^test/etap/.*.beam ^test/etap/.*.o ^test/etap/etap.erl http://git-wip-us.apache.org/repos/asf/couchdb/blob/cf3b48e4/test/bench/bench_marks.js ---------------------------------------------------------------------- diff --git a/test/bench/bench_marks.js b/test/bench/bench_marks.js deleted file mode 100644 index 4025adb..0000000 --- a/test/bench/bench_marks.js +++ /dev/null @@ -1,103 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -var NUM_DOCS = 2000; -var NUM_BATCHES = 20; - -var init = function() { - var db = new CouchDB("bench_mark_db", {"X-Couch-Full-Commit": "false"}); - db.deleteDb(); - db.createDb(); - return db; -}; - -var timeit = function(func) { - var startTime = (new Date()).getTime(); - func(); - return ((new Date()).getTime() - startTime) / 1000; -}; - -var report = function(name, rate) { - rate = Math.round(parseFloat(rate) * 100) / 100; - console.log("" + name + ": " + rate + " docs/second"); -}; - -var makeDocs = function(n) { - docs = []; - for (var i=0; i < n; i++) { - docs.push({"foo":"bar"}); - }; - return docs; -}; - -var couchTests = {}; - -couchTests.single_doc_insert = function() { - var db = init(); - var len = timeit(function() { - for(var i = 0; i < NUM_DOCS; i++) { - db.save({"foo": "bar"}); - } - }); - report("Single doc inserts", NUM_DOCS/len); -}; - -couchTests.batch_ok_doc_insert = function() { - var db = init(); - var len = timeit(function() { - for(var i = 0; i < NUM_DOCS; i++) { - db.save({"foo":"bar"}, {"batch":"ok"}); - } - }); - report("Single doc inserts with batch=ok", NUM_DOCS/len); -}; - -couchTests.bulk_doc_100 = function() { - var db = init(); - var len = timeit(function() { - for(var i = 0; i < NUM_BATCHES; i++) { - db.bulkSave(makeDocs(100)); - } - }); - report("Bulk docs - 100", (NUM_BATCHES*100)/len); -}; - -couchTests.bulk_doc_1000 = function() { - var db = init(); - var len = timeit(function() { - for(var i = 0; i < NUM_BATCHES; i++) { - db.bulkSave(makeDocs(1000)); - } - }); - report("Bulk docs - 1000", (NUM_BATCHES*1000)/len); -}; - - -couchTests.bulk_doc_5000 = function() { - var db = init(); - var len = timeit(function() { - for(var i = 0; i < NUM_BATCHES; i++) { - db.bulkSave(makeDocs(5000)); - } - }); - report("Bulk docs - 5000", (NUM_BATCHES*5000)/len); -}; - -couchTests.bulk_doc_10000 = function() { - var db = init(); - var len = timeit(function() { - for(var i = 0; i < NUM_BATCHES; i++) { - db.bulkSave(makeDocs(10000)); - } - }); - report("Bulk docs - 10000", (NUM_BATCHES*10000)/len); -}; http://git-wip-us.apache.org/repos/asf/couchdb/blob/cf3b48e4/test/bench/run.tpl ---------------------------------------------------------------------- diff --git a/test/bench/run.tpl b/test/bench/run.tpl deleted file mode 100755 index 9307863..0000000 --- a/test/bench/run.tpl +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -e - -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -SRC_DIR=%abs_top_srcdir% -SCRIPT_DIR=$SRC_DIR/share/www/script -JS_TEST_DIR=$SRC_DIR/test/javascript -JS_BENCH_DIR=$SRC_DIR/test/bench - -COUCHJS=%abs_top_builddir%/src/couchdb/priv/couchjs - -cat $SCRIPT_DIR/json2.js \ - $SCRIPT_DIR/couch.js \ - $JS_TEST_DIR/couch_http.js \ - $JS_BENCH_DIR/bench_marks.js \ - $JS_TEST_DIR/cli_runner.js \ - | $COUCHJS - -
