From 8c6dc6c9db1a4f4273e503cbf127a216d0f2ccc1 Mon Sep 17 00:00:00 2001
From: "neelesh.poli2006@gmail.com"
<72574589+neeleshpoli@users.noreply.github.com>
Date: Sat, 19 Oct 2024 19:01:44 -0500
Subject: [PATCH 1/5] Format numbers and dates per region, and make
improvements to benchmarking page
---
docs/.vitepress/components/FmtDateTime.vue | 19 +++
docs/.vitepress/components/FmtNum.vue | 18 +++
docs/.vitepress/theme/index.ts | 14 ++-
docs/about/benchmarks.md | 138 +++++++++++----------
4 files changed, 123 insertions(+), 66 deletions(-)
create mode 100644 docs/.vitepress/components/FmtDateTime.vue
create mode 100644 docs/.vitepress/components/FmtNum.vue
diff --git a/docs/.vitepress/components/FmtDateTime.vue b/docs/.vitepress/components/FmtDateTime.vue
new file mode 100644
index 000000000..b2d6e96db
--- /dev/null
+++ b/docs/.vitepress/components/FmtDateTime.vue
@@ -0,0 +1,19 @@
+
+
+
+
+{{ formattedDateTime }}
+
\ No newline at end of file
diff --git a/docs/.vitepress/components/FmtNum.vue b/docs/.vitepress/components/FmtNum.vue
new file mode 100644
index 000000000..1928b1372
--- /dev/null
+++ b/docs/.vitepress/components/FmtNum.vue
@@ -0,0 +1,18 @@
+
+
+
+{{ formattedNumber }}
+
\ No newline at end of file
diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts
index def4cfc87..2367c0228 100644
--- a/docs/.vitepress/theme/index.ts
+++ b/docs/.vitepress/theme/index.ts
@@ -3,6 +3,8 @@ import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'
+import FmtNum from '../components/FmtNum.vue'
+import FmtDateTime from '../components/FmtDateTime.vue'
export default {
extends: DefaultTheme,
@@ -12,6 +14,16 @@ export default {
})
},
enhanceApp({ app, router, siteData }) {
- // ...
+ app.config.globalProperties.$numberFormatter = new Intl.NumberFormat(navigator.languages);
+ app.config.globalProperties.$dateTimeFormatter = new Intl.DateTimeFormat(navigator.languages, {
+ year: "numeric",
+ month: "long",
+ day: "numeric",
+ hour: "numeric",
+ minute: "numeric",
+ timeZoneName: "short"
+ });
+ app.component('FmtNum', FmtNum);
+ app.component('FmtDateTime', FmtDateTime);
}
} satisfies Theme
diff --git a/docs/about/benchmarks.md b/docs/about/benchmarks.md
index 1e7ee3d71..ff0d5919c 100644
--- a/docs/about/benchmarks.md
+++ b/docs/about/benchmarks.md
@@ -1,13 +1,19 @@
-## Benchmarks
+# Benchmarks
-Here, I compare common Minecraft servers against Pumpkin.
+Here, common Minecraft servers are compared against Pumpkin.
-Is this comparison fair? Not really. While Pumpkin currently has far fewer features than other servers, which might suggest it uses fewer resources, it's important to consider that other servers have had years for optimization. Especially vanilla forks, which don’t need to rewrite the entire vanilla logic, can focus exclusively on optimizations.
+> [!NOTE]
+> All tests have been ran multiple times to guarantee consistent results.
+> All players did not move when spawning, only the initial 8 chunks were loaded.
+> All servers used their own terrain generation, no world was pre-loaded.
-ALL TESTS HAVE BEEN RAN MULTIPLE TIMES TO GUARANTEE CONSISTENT RESULTS
+> [!IMPORTANT]
+> `CPU Max` is usually higher with one player is as the initial chunks are being loaded.
-ALL PLAYERS DID NOT MOVE WHEN SPAWNING, ONLY THE INITIAL 8 CHUNKS WERE LOADED, THAT'S ALSO THE REASON CPU MAX IS USUALLY HIGH ON THE FIRST PLAYER
-ALL SERVERS USED THEIR OWN TERRAIN GENERATION, NO WORLD WAS PRE-LOADED
+> [!CAUTION]
+> **This comparison is unfair.** Pumpkin currently has far fewer features than other servers, which might suggest it uses fewer resources.
+> It's also important to consider that other servers have had years for optimization.
+> Vanilla forks, which don’t need to rewrite the entire vanilla logic, can focus exclusively on optimizations.

@@ -54,36 +60,36 @@ ALL SERVERS USED THEIR OWN TERRAIN GENERATION, NO WORLD WAS PRE-LOADED
Build: [8febc50](https://github.com/Snowiiii/Pumpkin/commit/8febc5035d5611558c13505b7724e6ca284e0ada)
-Compile args:`--release`
+Compile args: `--release`
Run args:
-**File Size:** 12,3MB
+**File Size:** MB
-**Startup time:** 8ms
+**Startup time:** ms
-**Shutdown time:** 0ms
+**Shutdown time:** ms
-| Players | RAM | CPU idle | CPU Max |
-| ------- | ------- | -------- | ------- |
-| 0 | 392,2KB | 0,0% | 0,0% |
-| 1 | 24,9MB | 0,0% | 4,0% |
-| 2 | 25,1MB | 0,0% | 0,6% |
-| 5 | 26,0MB | 0,0% | 1,0% |
-| 10 | 27,1MB | 0,0% | 1,5% |
+| Players | RAM | CPU Idle | CPU Max |
+| ------- | --------------------- | ---------------- | ------------------ |
+| 0 | KB | % | % |
+| 1 | MB | % | % |
+| 2 | MB | % | % |
+| 5 | MB | % | % |
+| 10 | MB | % | % |
-pumpkin does cache already loaded chunks, resulting in no extra RAM usage besides player data and minimal CPU usage
+Pumpkin does cache already loaded chunks, resulting in no extra RAM usage besides player data and minimal CPU usage.
#### Compile time
-Compiling from Nothing
+Compiling from Nothing:
-**Debug:** 10.35sec
-**Release:** 38.40sec
+**Debug:** sec
+**Release:** sec
-Recompilation (pumpkin crate)
+Recompilation (pumpkin crate):
-**Debug:** 1.82sec
-**Release:** 28.68sec
+**Debug:** sec
+**Release:** sec
## Vanilla
@@ -93,19 +99,19 @@ Compile args:
Run args: `nogui`
-**File Size:** 51,6MB
+**File Size:** MB
-**Startup time:** 7sec
+**Startup time:** sec
-**Shutdown time:** 4sec
+**Shutdown time:** sec
-| Players | RAM | CPU idle | CPU Max |
-| ------- | ----- | -------- | ------- |
-| 0 | 860MB | 0,1-0,3% | 51,0% |
-| 1 | 1.5GB | 0,9-1% | 41,0% |
-| 2 | 1.6GB | 1,0-1,1% | 10,0% |
-| 5 | 1.8GB | 2,0% | 20,0% |
-| 10 | 2,2GB | 4,0% | 24,0% |
+| Players | RAM | CPU idle | CPU Max |
+| ------- | ------------------ | ------------------------------------ | ------- |
+| 0 | 860MB | - % | 51% |
+| 1 | GB | - 1% | 41% |
+| 2 | GB | 1 - % | 10% |
+| 5 | GB | 2% | 20% |
+| 10 | GB | 4% | 24% |
## Paper
@@ -115,19 +121,20 @@ Compile args:
Run args: `nogui`
-**File Size:** 49,4MB
+**File Size:** MB
-**Startup time:** 7sec
+**Startup time:** sec
-**Shutdown time:** 3sec
+**Shutdown time:** sec
+
+| Players | RAM | CPU idle | CPU Max |
+| ------- | ------------------- | -------------------------------------- | ----------------- |
+| 0 | GB | - % | % |
+| 1 | GB | - % | % |
+| 2 | GB | - % | % |
+| 5 | GB | % | % |
+| 10 | GB | % | % |
-| Players | RAM | CPU idle | CPU Max |
-| ------- | ----- | -------- | ------- |
-| 0 | 1.1GB | 0,2-0,3% | 36,0% |
-| 1 | 1.7GB | 0,9-1,0% | 47,0% |
-| 2 | 1.8GB | 1-1-1,0% | 10,0% |
-| 5 | 1.9GB | 1.5% | 15,0% |
-| 10 | 2GB | 3,0% | 20,0% |
## Purpur
@@ -137,19 +144,19 @@ Compile args:
Run args: `nogui`
-**File Size:** 53,1MB
+**File Size:** MB
-**Startup time:** 8sec
+**Startup time:** sec
-**Shutdown time:** 4sec
+**Shutdown time:** sec
-| Players | RAM | CPU idle | CPU Max |
-| ------- | ----- | -------- | ------- |
-| 0 | 1.4GB | 0,2-0,3% | 25,0% |
-| 1 | 1.6GB | 0,7-1,0% | 35,0% |
-| 2 | 1.7GB | 1,1-1,3% | 9,0% |
-| 5 | 1.9GB | 1.6% | 20,0% |
-| 10 | 2.2GB | 2-2,5,0% | 26,0% |
+| Players | RAM | CPU idle | CPU Max |
+| ------- | ------------------- | -------------------------------------- | ----------------- |
+| 0 | GB | - % | % |
+| 1 | GB | - % | % |
+| 2 | GB | - % | % |
+| 5 | GB | % | % |
+| 10 | GB | - % | % |
## Minestom
@@ -161,20 +168,21 @@ Run args:
**Language:** Benchmarks ran with Kotlin 2.0.0 (Minestom itself is made with Java)
-**File Size:** 2,8MB (Library)
+**File Size:** MB (Library)
-**Startup time:** 310ms
+**Startup time:** ms
-**Shutdown time:** 0ms
+**Shutdown time:** ms
[Used example code from](https://minestom.net/docs/setup/your-first-server)
-| Players | RAM | CPU idle | CPU Max |
-| ------- | ----- | -------- | ------- |
-| 0 | 228MB | 0,1-0,3% | 1,0% |
-| 1 | 365MB | 0,9-1,0% | 5,0% |
-| 2 | 371MB | 1-1,1% | 4,0% |
-| 5 | 390MB | 1,0% | 6,0% |
-| 10 | 421MB | 3,0% | 9,0% |
+| Players | RAM | CPU idle | CPU Max |
+| ------- | ------------------- | --------------------------------------- | ---------------- |
+| 0 | MB | - % | % |
+| 1 | MB | - % | % |
+| 2 | MB | - % | % |
+| 5 | MB | % | % |
+| 10 | MB | % | % |
+
-Benchmarked at 15.10.2024 18:34 (UTC+2)
+Benchmarked at
From f0ca94ec421b5905bc044e2333467090627e35d3 Mon Sep 17 00:00:00 2001
From: "neelesh.poli2006@gmail.com"
<72574589+neeleshpoli@users.noreply.github.com>
Date: Sat, 19 Oct 2024 19:17:26 -0500
Subject: [PATCH 2/5] Fix typo
---
docs/about/benchmarks.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/about/benchmarks.md b/docs/about/benchmarks.md
index ff0d5919c..cad56c337 100644
--- a/docs/about/benchmarks.md
+++ b/docs/about/benchmarks.md
@@ -179,7 +179,7 @@ Run args:
| Players | RAM | CPU idle | CPU Max |
| ------- | ------------------- | --------------------------------------- | ---------------- |
| 0 | MB | - % | % |
-| 1 | MB | - % | % |
+| 1 | MB | - % | % |
| 2 | MB | - % | % |
| 5 | MB | % | % |
| 10 | MB | % | % |
From 41a0dbb6b410411250dac9574184f610f8bbf945 Mon Sep 17 00:00:00 2001
From: "neelesh.poli2006@gmail.com"
<72574589+neeleshpoli@users.noreply.github.com>
Date: Sat, 19 Oct 2024 19:17:54 -0500
Subject: [PATCH 3/5] Fix formatting
---
docs/about/benchmarks.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/docs/about/benchmarks.md b/docs/about/benchmarks.md
index cad56c337..f391cdb50 100644
--- a/docs/about/benchmarks.md
+++ b/docs/about/benchmarks.md
@@ -176,13 +176,13 @@ Run args:
[Used example code from](https://minestom.net/docs/setup/your-first-server)
-| Players | RAM | CPU idle | CPU Max |
-| ------- | ------------------- | --------------------------------------- | ---------------- |
-| 0 | MB | - % | % |
+| Players | RAM | CPU idle | CPU Max |
+| ------- | ------------------- | -------------------------------------- | ---------------- |
+| 0 | MB | - % | % |
| 1 | MB | - % | % |
-| 2 | MB | - % | % |
-| 5 | MB | % | % |
-| 10 | MB | % | % |
+| 2 | MB | - % | % |
+| 5 | MB | % | % |
+| 10 | MB | % | % |
Benchmarked at
From b36ca796bc4f238f229c611b36debadd526587f4 Mon Sep 17 00:00:00 2001
From: "neelesh.poli2006@gmail.com"
<72574589+neeleshpoli@users.noreply.github.com>
Date: Sat, 19 Oct 2024 20:04:21 -0500
Subject: [PATCH 4/5] Convert forgotten table
---
docs/about/benchmarks.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/about/benchmarks.md b/docs/about/benchmarks.md
index f391cdb50..a35386d8b 100644
--- a/docs/about/benchmarks.md
+++ b/docs/about/benchmarks.md
@@ -105,13 +105,13 @@ Run args: `nogui`
**Shutdown time:** sec
-| Players | RAM | CPU idle | CPU Max |
-| ------- | ------------------ | ------------------------------------ | ------- |
-| 0 | 860MB | - % | 51% |
-| 1 | GB | - 1% | 41% |
-| 2 | GB | 1 - % | 10% |
-| 5 | GB | 2% | 20% |
-| 10 | GB | 4% | 24% |
+| Players | RAM | CPU idle | CPU Max |
+| ------- | --------------------- | ---------------------------------------- | ------------------ |
+| 0 | MB | - % | % |
+| 1 | GB | - % | % |
+| 2 | GB | - % | % |
+| 5 | GB | % | % |
+| 10 | GB | % | % |
## Paper
From a7d786b2d619320365828a6ced8caebb9ddfda82 Mon Sep 17 00:00:00 2001
From: "neelesh.poli2006@gmail.com"
<72574589+neeleshpoli@users.noreply.github.com>
Date: Sun, 20 Oct 2024 08:58:39 -0500
Subject: [PATCH 5/5] Shifted labels around, fixed typo
---
docs/about/benchmarks.md | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/docs/about/benchmarks.md b/docs/about/benchmarks.md
index a35386d8b..63f89aa8e 100644
--- a/docs/about/benchmarks.md
+++ b/docs/about/benchmarks.md
@@ -2,14 +2,6 @@
Here, common Minecraft servers are compared against Pumpkin.
-> [!NOTE]
-> All tests have been ran multiple times to guarantee consistent results.
-> All players did not move when spawning, only the initial 8 chunks were loaded.
-> All servers used their own terrain generation, no world was pre-loaded.
-
-> [!IMPORTANT]
-> `CPU Max` is usually higher with one player is as the initial chunks are being loaded.
-
> [!CAUTION]
> **This comparison is unfair.** Pumpkin currently has far fewer features than other servers, which might suggest it uses fewer resources.
> It's also important to consider that other servers have had years for optimization.
@@ -56,6 +48,14 @@ Here, common Minecraft servers are compared against Pumpkin.
online mode was disabled for easier testing with non-premium accounts
+> [!NOTE]
+> All tests have been ran multiple times to guarantee consistent results.
+> All players did not move when spawning, only the initial 8 chunks were loaded.
+> All servers used their own terrain generation, no world was pre-loaded.
+
+> [!IMPORTANT]
+> `CPU Max` is usually higher with one player as the initial chunks are being loaded.
+
## Pumpkin
Build: [8febc50](https://github.com/Snowiiii/Pumpkin/commit/8febc5035d5611558c13505b7724e6ca284e0ada)