Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Winkler2011-12-21 11:21:48 +0000
committerStefan Winkler2011-12-21 11:24:09 +0000
commit694ab8f8f8bfb3812e57d2775a7c07f1435a5770 (patch)
tree463a622872b636ac801352ef2865de388eacb992
parent8f571e8721ded1f9b8f3c42b28859b7f38cbbf78 (diff)
downloadcdo-694ab8f8f8bfb3812e57d2775a7c07f1435a5770.tar.gz
cdo-694ab8f8f8bfb3812e57d2775a7c07f1435a5770.tar.xz
cdo-694ab8f8f8bfb3812e57d2775a7c07f1435a5770.zip
[366686] [DB] Reduce amount of update statements for non-audit mode
https://bugs.eclipse.org/bugs/show_bug.cgi?id=366686 Additional performance test case
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/DeletePerformanceTest.java29
1 files changed, 24 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/DeletePerformanceTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/DeletePerformanceTest.java
index 4e053e412a..c1ae50d895 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/DeletePerformanceTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/DeletePerformanceTest.java
@@ -55,17 +55,17 @@ public class DeletePerformanceTest extends PerformanceTest
}
@CleanRepositoriesBefore
- public void testDeleteRandom() throws Exception
+ public void _testDeleteRandom() throws Exception
{
Company company = initModel();
CDOTransaction transaction = (CDOTransaction)CDOUtil.getCDOObject(company).cdoView();
msg("Starting to remove elements ...");
- for (int i = 0; i < AMOUNT_ELEMENTS / 2; i++)
+ for (int i = 0; i < AMOUNT_ELEMENTS / 4; i++)
{
int currentSize = AMOUNT_ELEMENTS - i;
- int indexToRemove = random.nextInt(currentSize);
+ int indexToRemove = random.nextInt(currentSize - 1);
company.getCategories().remove(indexToRemove);
@@ -76,14 +76,14 @@ public class DeletePerformanceTest extends PerformanceTest
}
@CleanRepositoriesBefore
- public void testDeleteDeterministic() throws Exception
+ public void testDeleteEveryOther() throws Exception
{
Company company = initModel();
CDOTransaction transaction = (CDOTransaction)CDOUtil.getCDOObject(company).cdoView();
msg("Starting to remove elements ...");
- for (int i = 0; i < AMOUNT_ELEMENTS / 2; i++)
+ for (int i = 0; i < AMOUNT_ELEMENTS / 4; i++)
{
int indexToRemove = AMOUNT_ELEMENTS / 2 - i;
@@ -95,4 +95,23 @@ public class DeletePerformanceTest extends PerformanceTest
}
}
+ @CleanRepositoriesBefore
+ public void _testDeleteAtBeginning() throws Exception
+ {
+ Company company = initModel();
+ CDOTransaction transaction = (CDOTransaction)CDOUtil.getCDOObject(company).cdoView();
+
+ msg("Starting to remove elements ...");
+
+ for (int i = 0; i < AMOUNT_ELEMENTS / 4; i++)
+ {
+ int indexToRemove = 0;
+
+ company.getCategories().remove(indexToRemove);
+
+ startProbing();
+ transaction.commit();
+ stopProbing();
+ }
+ }
}

Back to the top