1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Is Config slow?

Discussion in 'Development' started by Mango, Aug 21, 2019.

  1. Mango

    Mango Spider

    Messages:
    9
    I'm currently creating a Plot plugin (I know there is one, but I'm making one anyway), and I don't really know how I should handle each plot property, which I have them stored in a yml file. Of course, I would have to access each plot data everytime something happens on them, such as block break, pvp, etc. So my question is, would it be a much better practice to store active Plot object in a single array, or is config fast and light enough that it shouldn't be much of a problem if just access/store data to config everytime it's needed?
     
    Last edited: Aug 21, 2019
  2. Gianluxx

    Gianluxx Slime

    Messages:
    94
    GitHub:
    Gianluxx
    If you import the config and modify it's fast enough. But saving on disk each time it's very slow
     
  3. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    Use async tasks if it is so slow
     
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Async is not the magical solution to all problems.
     
    radondev likes this.
  5. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    For configs works fine :)
     
  6. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    Configs are not a database. Anytime you want to access a single part of the data it contains it's necessary to load the entire file into memory. So yes, it's slow, and it gets slower and slower the more data you have.

    if you want to store structured data for a program to read, you should consider using a proper database like sqlite3.

    Please shut up if you're not going to provide a sensible answer to the actual question.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.