<commit_before>package com.orientechnologies.orient.test.database.speed;

import java.util.Set;


import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.orientechnologies.orient.core.db.graph.OGraphDatabase;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert;
import com.orientechnologies.orient.core.record.impl.ODocument;

public class GraphDatabaseSuperNodeSpeedTest {

	private static final String	DEFAULT_DB_URL			= "local:database/graphtest";
	private static final String	DEFAULT_DB_USER			= "admin";
	private static final String	DEFAULT_DB_PASSWORD	= "<PASSWORD>";
	private static final int		MAX									= 1000000;
	private OGraphDatabase			database;

	@BeforeClass
	public void setUpClass() {
		database = new OGraphDatabase(DEFAULT_DB_URL);
		if (database.exists())
			database.delete();

		database.create();
		database.close();

		database.open(DEFAULT_DB_USER, DEFAULT_DB_PASSWORD);
	}

	@AfterClass
	public void tearDownClass() {
		database.close();
	}

	@Test
	public void saveEdges() {
		database.declareIntent(new OIntentMassiveInsert());

		ODocument v = database.createVertex();
		v.field("name", "superNode");

		long insertBegin = System.currentTimeMillis();

		long begin = insertBegin;
		for (int i = 1; i <= MAX; ++i) {
			database.createEdge(v, database.createVertex().field("id", i)).save();
			if (i % 100000 == 0) {
				final long now = System.currentTimeMillis();
				System.out.printf("\nInserted %d edges, elapsed %d ms. v.out=%d", i, now - begin, ((Set<?>) v.field("out")).size());
				begin = System.currentTimeMillis();
			}
		}
		database.declareIntent(null);

		long now = System.currentTimeMillis();
		System.out.printf("\nInsertion completed in %dms. DB edges %d, DB vertices %d", now - begin, database.countEdges(),
				database.countVertexes());

		int i = 1;
		for (OIdentifiable e : database.getOutEdges(v)) {
			Assert.assertEquals(database.getInVertex(e).field("id"), i);
			if (i % 100000 == 0) {
				now = System.currentTimeMillis();
				System.out.printf("\nRead %d edges and %d vertices, elapsed %d ms", i, i, now - begin);
				begin = System.currentTimeMillis();
			}
			i++;
		}

	}
}<commit_msg>Updated test<commit_after>package com.orientechnologies.orient.test.database.speed;

import java.util.Set;

import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.orientechnologies.orient.core.db.graph.OGraphDatabase;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert;
import com.orientechnologies.orient.core.record.impl.ODocument;

public class GraphDatabaseSuperNodeSpeedTest {

	private static final String	DEFAULT_DB_URL			= "local:database/graphtest";
	private static final String	DEFAULT_DB_USER			= "admin";
	private static final String	DEFAULT_DB_PASSWORD	= "<PASSWORD>";
	private static final int		MAX									= 1000000;
	private OGraphDatabase			database;

	@BeforeClass
	public void setUpClass() {
		database = new OGraphDatabase(DEFAULT_DB_URL);
		if (database.exists())
			database.delete();

		database.create();
		database.close();

		database.open(DEFAULT_DB_USER, DEFAULT_DB_PASSWORD);
	}

	@AfterClass
	public void tearDownClass() {
		database.close();
	}

	@Test
	public void saveEdges() {
		database.declareIntent(new OIntentMassiveInsert());

		ODocument v = database.createVertex();
		v.field("name", "superNode");

		long insertBegin = System.currentTimeMillis();

		long begin = insertBegin;
		for (int i = 1; i <= MAX; ++i) {
			database.createEdge(v, database.createVertex().field("id", i)).save();
			if (i % 100000 == 0) {
				final long now = System.currentTimeMillis();
				System.out.printf("\nInserted %d edges, elapsed %d ms. v.out=%d", i, now - begin, ((Set<?>) v.field("out")).size());
				begin = System.currentTimeMillis();
			}
		}

		long now = System.currentTimeMillis();
		System.out.printf("\nInsertion completed in %dms. DB edges %d, DB vertices %d", now - insertBegin, database.countEdges(),
				database.countVertexes());

		int i = 1;
		for (OIdentifiable e : database.getOutEdges(v)) {
			Assert.assertEquals(database.getInVertex(e).field("id"), i);
			if (i % 100000 == 0) {
				now = System.currentTimeMillis();
				System.out.printf("\nRead %d edges and %d vertices, elapsed %d ms", i, i, now - begin);
				begin = System.currentTimeMillis();
			}
			i++;
		}
		database.declareIntent(null);

	}
}
{'fraction_non_alphanumeric': 0.13576017130620985, 'fraction_numerical': 0.009850107066381156, 'mean_word_length': 4.463157894736842, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1470117', 'n_tokens_mistral': 1694, 'n_tokens_neox': 1493, 'n_words': 335}