def __init__(self): self.conf = P0Config.shared() self.edges = [ Edge(first=1, second=2, weight=4, _id=100), Edge(first=2, second=3, weight=20, _id=1100), Edge(first=3, second=4, weight=10, _id=1200), Edge(first=4, second=5, weight=3, _id=1300), Edge(first=5, second=3, weight=2, _id=1400), Edge(first=4, second=1, weight=5, _id=1500), Edge(first=8, second=6, weight=4, _id=1600), Edge(first=8, second=7, weight=2, _id=1700), Edge(first=6, second=1, weight=3, _id=1800), Edge(first=7, second=1, weight=2, _id=1900), ]
def __init__(self): self.conf = P0Config.shared()
def benchmark_parsing_speed_pynum(self, dataset: dict): dataset_name = dataset['name'] p = self.conf.normalize_path(dataset['path']) print(f'-- Bulk importing: {dataset_name} -> Pynum') def sample(): pynum.sample_edges(p, 8) return dataset['edges'] counter = MicroBench( benchmark_name='Sequential Writes: Import CSV', func=lambda: sample(), database='Sampling in Unum', dataset=dataset['name'], source=self.conf.default_stats_file, device_name=self.conf.device_name, limit_iterations=1, limit_seconds=None, limit_operations=None, ) counter.run_if_missing() if __name__ == "__main__": c = P0Config(device_name='MacbookPro') try: P2Import().run() finally: c.default_stats_file.dump_to_file()
def __init__(self): self.conf = P0Config.shared() self.count_finds = self.conf.count_finds self.count_analytics = self.conf.count_analytics self.count_changes = self.conf.count_changes self.clear()
from P0Config import P0Config from P1Test import P1Test from P2Import import P2Import from P3Bench import P3Bench from P4Print import P4Print if __name__ == "__main__": print('Welcome to PyStorageDBs Graphs Benchmark!') conf = P0Config.shared() try: print('- Testing DBs!') P1Test().run() print('- Importing datasets!') P2Import().run() print('- Benchmarking!') P3Bench().run() print('- Exporting stats!') P4Print().run() finally: conf.default_stats_file.dump_to_file()
def __init__(self, max_seconds_per_query=60): self.conf = P0Config.shared() self.max_seconds_per_query = max_seconds_per_query self.tasks = P3TasksSampler()