Huge performance improvement through better queue system.

This commit is contained in:
User user
2021-05-19 13:50:04 +02:00
parent ee3123f400
commit 6c65d2c83d
4 changed files with 43 additions and 37 deletions

View File

@ -30,13 +30,13 @@ async function benchmark(
Promise.resolve().then(async () => {
const largeText = "hallowelt!".repeat(250);
const lg = new LoggingBase({
console: false,
});
const fs = new FileAdapter("logs/benchmark", Number.MAX_SAFE_INTEGER);
await lg.addAdapter(fs);
await benchmark("large data", 100000, async (cnt) => {
const lg = new LoggingBase({
console: false,
});
const fs = new FileAdapter("logs/benchmark", Number.MAX_SAFE_INTEGER);
await lg.addAdapter(fs);
console.time("Logging");
for (let i = 0; i < cnt; i++) {
lg.log(largeText);
@ -46,5 +46,6 @@ Promise.resolve().then(async () => {
await fs.close();
await lg.close();
});
console.table(results);
});