-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from abdelaziz-mahdy/updated-data-json
Migrating to serverpod v2 and updating data scripts and using readme template generator
- Loading branch information
Showing
87 changed files
with
4,035 additions
and
4,999 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Backend Benchmark Repository | ||
|
||
## Table of Contents | ||
- [Introduction](#introduction) | ||
- [Prerequisites](#prerequisites) | ||
- [Completed Benchmarks](#completed-benchmarks) | ||
- [Python](#python) | ||
- [Dart](#dart) | ||
- [JavaScript/TypeScript](#javascripttypescript) | ||
- [C#](#c) | ||
- [Go](#go) | ||
- [Rust](#rust) | ||
- [Testing Tool: Locust](#testing-tool-locust) | ||
- [Benchmark Visualization](#benchmark-visualization) | ||
- [Database Endpoints](#database-endpoints) | ||
- [Static Endpoints](#static-endpoints) | ||
|
||
## Introduction | ||
This repository serves as a comprehensive resource for comparing backend technologies based on speed and load capabilities. Our benchmarks focus on write and read operations, as well as requests to static endpoints, reflecting real-world usage scenarios to assist developers and decision-makers in choosing the most suitable backend framework for their needs. | ||
|
||
## Prerequisites | ||
- Docker installed on the system to run the benchmarks. | ||
- The `scripts/start_tests.sh` script is used to launch each test and create the graphs. | ||
|
||
## Completed Benchmarks | ||
Benchmarks are categorized into: | ||
1. **Database Tests (`db_test`):** Involving database operations such as read and write requests. | ||
2. **Static Endpoint Tests (`no_db_test`):** Involving requests to static endpoints without database interaction. | ||
|
||
### Python | ||
- **Django** (Sync and Async) - Connection Pooling with PgBouncer. | ||
|
||
### Dart | ||
- **Serverpod** | ||
|
||
### JavaScript/TypeScript | ||
- **Express** (Node and Bun) | ||
|
||
### C# | ||
- **.Net Core** | ||
|
||
### Go | ||
|
||
### Rust | ||
|
||
## Testing Tool: Locust | ||
- **Configuration:** | ||
- Users: 10000 | ||
- Spawn Rate: 10 users/second | ||
- Test Duration: 1000 seconds | ||
|
||
## Benchmark Visualization | ||
Visual comparisons for database endpoints and static endpoints are provided to showcase performance differences across technologies. | ||
|
||
# Database Endpoints | ||
|
||
## Comparison Graph with db endpoints | ||
![Comparison Graph](comparison_graph_db_test.png?v={version}) | ||
|
||
## Detailed Graphs for each backend | ||
{db_endpoint_graphs} | ||
|
||
# Static Endpoints | ||
|
||
## Comparison Graph with static endpoints | ||
![Comparison Graph](comparison_graph_no_db_test.png?v={version}) | ||
|
||
## Detailed Graphs for each backend | ||
{static_endpoint_graphs} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
backends/dart/server-pod/benchmark_client/lib/src/protocol/example.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ | ||
/* To generate run: "serverpod generate" */ | ||
|
||
// ignore_for_file: library_private_types_in_public_api | ||
// ignore_for_file: public_member_api_docs | ||
// ignore_for_file: implementation_imports | ||
// ignore_for_file: use_super_parameters | ||
// ignore_for_file: type_literal_in_constant_pattern | ||
|
||
// ignore_for_file: no_leading_underscores_for_library_prefixes | ||
import 'package:serverpod_client/serverpod_client.dart' as _i1; | ||
|
||
abstract class Example implements _i1.SerializableModel { | ||
Example._({ | ||
required this.name, | ||
required this.data, | ||
}); | ||
|
||
factory Example({ | ||
required String name, | ||
required int data, | ||
}) = _ExampleImpl; | ||
|
||
factory Example.fromJson(Map<String, dynamic> jsonSerialization) { | ||
return Example( | ||
name: jsonSerialization['name'] as String, | ||
data: jsonSerialization['data'] as int, | ||
); | ||
} | ||
|
||
String name; | ||
|
||
int data; | ||
|
||
Example copyWith({ | ||
String? name, | ||
int? data, | ||
}); | ||
@override | ||
Map<String, dynamic> toJson() { | ||
return { | ||
'name': name, | ||
'data': data, | ||
}; | ||
} | ||
|
||
@override | ||
String toString() { | ||
return _i1.SerializationManager.encode(this); | ||
} | ||
} | ||
|
||
class _ExampleImpl extends Example { | ||
_ExampleImpl({ | ||
required String name, | ||
required int data, | ||
}) : super._( | ||
name: name, | ||
data: data, | ||
); | ||
|
||
@override | ||
Example copyWith({ | ||
String? name, | ||
int? data, | ||
}) { | ||
return Example( | ||
name: name ?? this.name, | ||
data: data ?? this.data, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.