Refactor concurrency handling and improve sleep precision in concurrency.dart and header.dart
This commit is contained in:
@@ -40,7 +40,7 @@ class Sweepstore {
|
||||
keyHash: key.hashCode,
|
||||
writeSize: 0, // Placeholder
|
||||
onApproved: () {
|
||||
print("Writing key: $key with hash ${key.hashCode} and value: $value");
|
||||
// print("Writing key: $key with hash ${key.hashCode} and value: $value");
|
||||
},
|
||||
debugLabel: key
|
||||
);
|
||||
@@ -60,16 +60,16 @@ Future<void> main() async {
|
||||
|
||||
Sweepstore store = Sweepstore(filePath);
|
||||
store.initialise(
|
||||
concurrentWorkers: 20
|
||||
concurrentWorkers: 18
|
||||
);
|
||||
initialiseMasterListener(file.openSync(mode: FileMode.append));
|
||||
|
||||
print(binaryDump(file.readAsBytesSync()));
|
||||
|
||||
int iteration = 1;
|
||||
int iteration = 100;
|
||||
|
||||
for (int j = 0; j < iteration; j++) {
|
||||
int concurrencyTest = 256;
|
||||
int concurrencyTest = 128;
|
||||
final receivePort = ReceivePort();
|
||||
int completedJobs = 0;
|
||||
|
||||
@@ -101,5 +101,7 @@ Future<void> main() async {
|
||||
|
||||
print('\x1B[95mAll jobs completed!\x1B[0m');
|
||||
print('\x1B[95mTime taken: ${stopwatch.elapsedMilliseconds}ms (${stopwatch.elapsed.inSeconds}s)\x1B[0m');
|
||||
|
||||
// sleep(Duration(seconds: 2));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user