1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved skript-yaml memory storage vs skript variables

Discussion in 'Skript' started by fly, Jul 27, 2018.

Thread Status:
Not open for further replies.
  1. fly

    fly New Member

    Joined:
    May 11, 2017
    Messages:
    9
    Likes Received:
    0
    When creating a stat system for users, I first used yaml with skutilities.
    Then after a while, I noticed that skutilites read and wrote the whole file every time I changed a single value. So I switched to saving the player variables in skript and accessing skript variables instead of yaml - and only saving and loading from yaml when the player joins/exits for offline access purposes.

    With that, I was planning to create an addon myself that loaded yaml files more effectively since skutilites utilized not the most effective methods.

    But today I found skript-yaml, which apparently did what I was planning to do - but probably even better by loading the yaml values to the server's memory at one go, but also keeping them there.

    tl;dr
    Which led me to the question - I'm pretty sure that loading from memory is the fastest loading method, but is skript-yaml's methods faster than skript variables?
    Because if that's the case I'm planning on refactoring my whole code to just get all variables from skript-yaml's loaded yaml values instead.
     
  2. Best Answer:
    Post #2 by jaylawl, Jul 27, 2018
  3. jaylawl

    jaylawl Active Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    hey fly. skripts variables are faster, however skript yaml is a lot faster than skutilities yaml saving
     
    fly likes this.
  4. fly

    fly New Member

    Joined:
    May 11, 2017
    Messages:
    9
    Likes Received:
    0
    Thanks for the confirmation :emoji_slight_smile:
     
  5. jaylawl

    jaylawl Active Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    You're welcome! I recommend using reading and saving YAML only on rare events, for example when a player logs in/out, or when certain data must be reloaded. If you do that you should never encounter any lag issues - if done right of course
     
Thread Status:
Not open for further replies.

Share This Page

Loading...