From 62de768a2a37dacfd2f860b14e5fcac125bde079 Mon Sep 17 00:00:00 2001 From: Lucas Niewohner Date: Sat, 13 Jan 2024 19:20:06 -0700 Subject: [PATCH] Export works! The export size is hideous but I have the opportunity to stop Java-ing and filter down using Python instead, and you best believe I'mma do that. --- src/main/java/com/hermanoid/nerd/RecipeDumper.java | 8 ++------ .../info_extractors/GTDefaultRecipeInfoExtractor.java | 8 +++++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/hermanoid/nerd/RecipeDumper.java b/src/main/java/com/hermanoid/nerd/RecipeDumper.java index 33fc196..3530376 100644 --- a/src/main/java/com/hermanoid/nerd/RecipeDumper.java +++ b/src/main/java/com/hermanoid/nerd/RecipeDumper.java @@ -143,13 +143,9 @@ private JsonObject extractJsonRecipeData(QueryResult queryResult){ } public Stream getQueryDumps(List items) { - // TODO: Experiment with parallelization here - // Since the bulk of work here is the query, which is already parallel, - // I'm not sure how much performance gain (if any) this would cause. - return items.stream() -// .limit(500) + // Parallelization doesn't help a *lot* but it is like a 2x speedup so I'll take it + return items.parallelStream() .map(this::performQuery) -// .parallel() .map(this::extractJsonRecipeData); } diff --git a/src/main/java/com/hermanoid/nerd/info_extractors/GTDefaultRecipeInfoExtractor.java b/src/main/java/com/hermanoid/nerd/info_extractors/GTDefaultRecipeInfoExtractor.java index 0d36667..5133edf 100644 --- a/src/main/java/com/hermanoid/nerd/info_extractors/GTDefaultRecipeInfoExtractor.java +++ b/src/main/java/com/hermanoid/nerd/info_extractors/GTDefaultRecipeInfoExtractor.java @@ -4,6 +4,7 @@ import codechicken.nei.util.NBTJson; import com.google.gson.*; import com.google.gson.reflect.TypeToken; +import gregtech.api.enums.Materials; import gregtech.api.util.GT_Recipe; import gregtech.common.fluid.GT_Fluid; import gregtech.nei.GT_NEI_DefaultHandler; @@ -45,7 +46,12 @@ private static class GTRecipeExclusionStrategy implements ExclusionStrategy { "mOreDictAlt" )); - List badTypes = Arrays.asList(GT_NEI_DefaultHandler.class, ItemStack.class, FluidStack.class); + List badTypes = Arrays.asList( + GT_NEI_DefaultHandler.class, + ItemStack.class, + FluidStack.class, + Materials.class // Pops up in metadata (contains lots of images and such) + ); @Override public boolean shouldSkipField(FieldAttributes f) {