PluginBugs / Issues-ItemsAdder

Repository used to keep track of issues of my plugin ItemsAdder
https://itemsadder.devs.beer
52 stars 21 forks source link

CustomCrops performance (not ItemsAdder) #2126

Closed LuluxClient closed 1 year ago

LuluxClient commented 1 year ago

Terms

Discord tag (optional)

Lulux#4614

What happened?

I've noticed that after enabling custom blocks to ItemsAdder that it was causing some heavy lag and huge CPU spikes: https://spark.lucko.me/kVwZUXcuvE . I'm using CustomCrops that creates new farms with Real_wire (tripewire) and noteblocks and it hooks on ItemsAdder

Steps to reproduce the issue

Have lots of custom blocs and real_wire

Server version

This server is running Pufferfish version git-Pufferfish-40 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: deb9638 on HEAD) You are running 6 versions beyond. Please update your server when possible to maintain stability, security, and receive the latest optimizations. Previous version: git-Prismarine-"69d16d0" (MC: 1.19.2)

ItemsAdder Version

3.3.0-beta-r8

ProtocolLib Version

5.0.0

LoneLibs Version

1.0.21

LightAPI Version (optional)

none

LibsDisguises Version (optional)

10.0.31

FULL server log

private

Error (optional)

none

ItemsAdder config.yml

metrics: false
update-checker: false
disable-plugin-loading-messages_DONT_ASK_ME_FOR_SUPPORT_IF_YOU_SET_TRUE__THANKS: false
resource-pack:
  hosting:
    no-host:
      enabled: false
    auto-external-host:
      enabled: false
    self-host:
      enabled: false
      server-ip: aaa
      pack-port: aaaa
    external-host:
      enabled: true
      url: aaa
      skip-url-file-type-check___DONT_ASK_HELP_IF_SET_TRUE: false
  apply-on-join: true
  kick-player-on-decline: true
  kick-player-on-fail: false
  delay-ticks: 40
  notify-other-plugins-interfering: true
  title:
    enabled: true
  protect-player:
    black-screen: true
    hide-hud: true
    cancel-movement: true
    lock-player: true
  command:
    usage-cooldown-seconds: 60
  custom-font:
    enabled: false
    name: ipaexg.ttf
    shift: '[0,0]'
    size: 11.0
    oversample: 2.0
  thin-font:
    enabled: false
  zip:
    protect-file-from-unzip:
      enabled: true
      extreme: true
    compress-png-files: true
    compress-json-files: true
    overwrite-vanilla-models: false
    overwrite-vanilla-lang-json: false
    generate-custom-armors-textures:
      vanilla_1_17: true
      optifine: false
    disable-overwrite-leather-armor-layers-textures: false
    fix_transparent_noteblocks__disable-for-more-performance: true
    ignore-files-ext:
    - db
    - yml
    - xcf
    - html
  items:
    CustomModelData-starting-value:
      ALL: 10000
      DIAMOND: 11000
config_files:
  lang: en
  dictionaries-lang: en
  extract-default-resources: false
  extract-default-configs: false
  legacy_pack: false
blocks:
  light-api: true
  fix-liquids-flow: true
  fix-floating-blocks: true
  fix-glitched-blocks:
    enabled: true
    only-new-chunks: false
  cancel-break-wrong-tool:
    enabled: true
    send-actionbar: true
  campfire:
    unlit-on-place: true
    allow-any-item: true
  disable-REAL: false # Lulux #true
  disable-REAL_TRANSPARENT: true # Lulux #false
  disable-REAL_NOTE: false
  disable-REAL_WIRE: false # true avant
  disable-FIRE: false
items:
  fix-show-attack-and-damage-as-lore: true
  give_death_location_maps: false
  hide-custom-durability-lore: true
liquids:
  enabled: true
huds:
  enabled: true
mobs:
  disable-MOB-behaviour__DISABLE_AT_YOUR_OWN_RISK: false
font_images:
  chat:
    enabled: true
    doublecheck-permission__disable-for-more-performance: false
    add-hover-suggestion: true
  command:
    enabled: true
    commandblocks: true
    excluded:
    - home
    - sethome
    - tpa
  sign:
    enabled: true
  book:
    enabled: true
  anvil:
    enabled: true
  inventory-title:
    enabled: true
  vault-prefix-suffix:
    enabled: true
    update-every-ticks: 1200
  scoreboard-teams:
    enabled: false
    update-every-ticks: 3600
  player-display-name:
    enabled: true
    update-every-ticks: 1200
  replace-in-customitems-name-and-lore: true
effects:
  hide-scoreboard-numbers: false
  text-effects:
    enabled: true
    replace-in-customitems-name-and-lore: true
    chat:
      enabled: true
    sign:
      enabled: true
    book:
      enabled: true
    anvil:
      enabled: true
entities:
  max-furniture-vehicles-per-chunk: 60
  allow-removing-old-furnitures_2_3_11: false
  custom-entitites:
    enabled: false
    interval-rendering-packets-ticks: 1
    emotes: false
    optimized-packets: true
recipes:
  hide-vanilla-unrecognized-recipe-errors: true
  fix-packet-too-large-kick: false
  custom-recipes:
    unlock:
      all-on-join: false
      on-pickup:
        any: false
        ingredients: true
  remove-vanilla-recipes:
    enabled: true
    list:
      DIAMOND_SWORD: false
      IRON_INGOT: false
debug:
  items:
    log-files-loading: false
    log-items-loading: false
    log-items-loading-disabled: false
    log-font-images-loading: false
    log-huds-loading: false
    log-attribute-modifiers-loading: false
    log-warnings: false
    log-loots-loading: false
    log-loots-loading-disabled: false
    log-armors-loading: false
  recipes:
    log-recipes-loading: false
    log-recipes-loading-disabled: false
    log-recipes-removed-vanilla: false
    log-fix-packet-too-large: false
    log-recipes-unknown-item: false
  resource-pack:
    log-extract-default-resources: false
    log-not-extract-default-resources-already-exist: false
  blocks:
    log-save: true
    log-save-on-unload: true
    log-mined-unknown-blocks: true
  worlds-populators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-populators: false
    log-loading-no-world: true
    log-generation: false
  trees-populators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-populators: false
    log-loading-no-world: true
    log-generation: false
  surface-decorators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-decorators: false
    log-loading-no-world: true
    log-generation: false
  player-stats:
    log-save: false
  performance:
    loading-ms: true
  huds:
    log-triggers: false
  other:
    log-dictionaries-loading: false
    log-liquids-loading: false
    log-minecraft_lang_overwrite-loading: false
  categories:
    log-total-loaded: true
    log-single-loaded: false
    log-single-loaded-overwrite: false
    log-single-skip: false
    log-icon-failed-load: false
  entities:
    log-files-loading: false
    log-entities-loading: false
    log-entities-loading-disabled: false
  cave-decorators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-decorators: false
    log-loading-no-world: true
    log-generation: false
loots:
  allow-loots-drop-from-spawners-using-silk-touch: false
chat-preview: false

Problematic items yml configuration file (optional)

metrics: false
update-checker: false
disable-plugin-loading-messages_DONT_ASK_ME_FOR_SUPPORT_IF_YOU_SET_TRUE__THANKS: false
resource-pack:
  hosting:
    no-host:
      enabled: false
    auto-external-host:
      enabled: false
    self-host:
      enabled: false
      server-ip: aaa
      pack-port: aaaa
    external-host:
      enabled: true
      url: aaa
      skip-url-file-type-check___DONT_ASK_HELP_IF_SET_TRUE: false
  apply-on-join: true
  kick-player-on-decline: true
  kick-player-on-fail: false
  delay-ticks: 40
  notify-other-plugins-interfering: true
  title:
    enabled: true
  protect-player:
    black-screen: true
    hide-hud: true
    cancel-movement: true
    lock-player: true
  command:
    usage-cooldown-seconds: 60
  custom-font:
    enabled: false
    name: ipaexg.ttf
    shift: '[0,0]'
    size: 11.0
    oversample: 2.0
  thin-font:
    enabled: false
  zip:
    protect-file-from-unzip:
      enabled: true
      extreme: true
    compress-png-files: true
    compress-json-files: true
    overwrite-vanilla-models: false
    overwrite-vanilla-lang-json: false
    generate-custom-armors-textures:
      vanilla_1_17: true
      optifine: false
    disable-overwrite-leather-armor-layers-textures: false
    fix_transparent_noteblocks__disable-for-more-performance: true
    ignore-files-ext:
    - db
    - yml
    - xcf
    - html
  items:
    CustomModelData-starting-value:
      ALL: 10000
      DIAMOND: 11000
config_files:
  lang: en
  dictionaries-lang: en
  extract-default-resources: false
  extract-default-configs: false
  legacy_pack: false
blocks:
  light-api: true
  fix-liquids-flow: true
  fix-floating-blocks: true
  fix-glitched-blocks:
    enabled: true
    only-new-chunks: false
  cancel-break-wrong-tool:
    enabled: true
    send-actionbar: true
  campfire:
    unlit-on-place: true
    allow-any-item: true
  disable-REAL: false # Lulux #true
  disable-REAL_TRANSPARENT: true # Lulux #false
  disable-REAL_NOTE: false
  disable-REAL_WIRE: false # true avant
  disable-FIRE: false
items:
  fix-show-attack-and-damage-as-lore: true
  give_death_location_maps: false
  hide-custom-durability-lore: true
liquids:
  enabled: true
huds:
  enabled: true
mobs:
  disable-MOB-behaviour__DISABLE_AT_YOUR_OWN_RISK: false
font_images:
  chat:
    enabled: true
    doublecheck-permission__disable-for-more-performance: false
    add-hover-suggestion: true
  command:
    enabled: true
    commandblocks: true
    excluded:
    - home
    - sethome
    - tpa
  sign:
    enabled: true
  book:
    enabled: true
  anvil:
    enabled: true
  inventory-title:
    enabled: true
  vault-prefix-suffix:
    enabled: true
    update-every-ticks: 1200
  scoreboard-teams:
    enabled: false
    update-every-ticks: 3600
  player-display-name:
    enabled: true
    update-every-ticks: 1200
  replace-in-customitems-name-and-lore: true
effects:
  hide-scoreboard-numbers: false
  text-effects:
    enabled: true
    replace-in-customitems-name-and-lore: true
    chat:
      enabled: true
    sign:
      enabled: true
    book:
      enabled: true
    anvil:
      enabled: true
entities:
  max-furniture-vehicles-per-chunk: 60
  allow-removing-old-furnitures_2_3_11: false
  custom-entitites:
    enabled: false
    interval-rendering-packets-ticks: 1
    emotes: false
    optimized-packets: true
recipes:
  hide-vanilla-unrecognized-recipe-errors: true
  fix-packet-too-large-kick: false
  custom-recipes:
    unlock:
      all-on-join: false
      on-pickup:
        any: false
        ingredients: true
  remove-vanilla-recipes:
    enabled: true
    list:
      DIAMOND_SWORD: false
      IRON_INGOT: false
debug:
  items:
    log-files-loading: false
    log-items-loading: false
    log-items-loading-disabled: false
    log-font-images-loading: false
    log-huds-loading: false
    log-attribute-modifiers-loading: false
    log-warnings: false
    log-loots-loading: false
    log-loots-loading-disabled: false
    log-armors-loading: false
  recipes:
    log-recipes-loading: false
    log-recipes-loading-disabled: false
    log-recipes-removed-vanilla: false
    log-fix-packet-too-large: false
    log-recipes-unknown-item: false
  resource-pack:
    log-extract-default-resources: false
    log-not-extract-default-resources-already-exist: false
  blocks:
    log-save: true
    log-save-on-unload: true
    log-mined-unknown-blocks: true
  worlds-populators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-populators: false
    log-loading-no-world: true
    log-generation: false
  trees-populators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-populators: false
    log-loading-no-world: true
    log-generation: false
  surface-decorators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-decorators: false
    log-loading-no-world: true
    log-generation: false
  player-stats:
    log-save: false
  performance:
    loading-ms: true
  huds:
    log-triggers: false
  other:
    log-dictionaries-loading: false
    log-liquids-loading: false
    log-minecraft_lang_overwrite-loading: false
  categories:
    log-total-loaded: true
    log-single-loaded: false
    log-single-loaded-overwrite: false
    log-single-skip: false
    log-icon-failed-load: false
  entities:
    log-files-loading: false
    log-entities-loading: false
    log-entities-loading-disabled: false
  cave-decorators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-decorators: false
    log-loading-no-world: true
    log-generation: false
loots:
  allow-loots-drop-from-spawners-using-silk-touch: false
chat-preview: false

Other files, you can drag and drop them here to upload. (optional)

https://spark.lucko.me/kVwZUXcuvE

Screenshots/Videos (you can drag and drop files or paste links)

No response

LoneDev6 commented 1 year ago

Now you see why I decided to avoid coding custom farms directly into itemsadder.

LoneDev6 commented 1 year ago

Anyway most of the lag is caused by CustomCrops plugin not by ItemsAdder. Ask them to optimize the code, getType is using a lot of CPU.

image

ItemsAdder itself is not using a lot of CPU.

image

LuluxClient commented 1 year ago

Anyway most of the lag is caused by CustomCrops plugin not by ItemsAdder. Ask them to optimize the code, getType is using a lot of CPU.

image

ItemsAdder itself is not using a lot of CPU.

image

Hey thanks for the quick answer, I've also contacted them and I'm currently waiting on an answer from them !

LoneDev6 commented 1 year ago

A quick guess is that they rely entirely on the Spigot API for very fast checks, this is a bad idea since the Spigot API is not optimized for such frequency. They should switch to NMS for some of their logic.