From fac140907e2144789f25d67bc9a82f0382f3bbb9 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Mon, 7 Jul 2025 14:06:05 +0200 Subject: perftest --- src/main/kotlin/repo/ItemCache.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/kotlin/repo/ItemCache.kt b/src/main/kotlin/repo/ItemCache.kt index 14decd8..acbf2f3 100644 --- a/src/main/kotlin/repo/ItemCache.kt +++ b/src/main/kotlin/repo/ItemCache.kt @@ -196,10 +196,17 @@ object ItemCache : IReloadable { } @ExpensiveItemCacheApi - fun NEUItem?.asItemStack(idHint: SkyblockId? = null, loreReplacements: Map? = null): ItemStack { + fun NEUItem?.asItemStack( + idHint: SkyblockId? = null, + loreReplacements: Map? = null, + isCacheRebuild: Boolean = false + ): ItemStack { if (this == null) return brokenItemStack(null, idHint) var s = cache[this.skyblockItemId] if (s == null) { + if (!isCacheRebuild) { + println("NON CACHE REBUILD DETECT! PREPARE TO BE TERMINATED!") + } s = asItemStackNow() cache[this.skyblockItemId] = s } @@ -266,7 +273,7 @@ object ItemCache : IReloadable { items.values.chunked(500).map { chunk -> async { chunk.forEach { - it.asItemStack() // Rebuild cache + it.asItemStack(isCacheRebuild = true) // Rebuild cache } } }.awaitAll() -- cgit