Other [OUTDATED] Don't use YAML.

  • 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!

Status
Not open for further replies.
hmm this is good information however options can't be called in different scripts and using variables would fill up the .cvs file if storing a large amount of information which would lead to performance drop anyway

A large cvs file might take a while to load on server start but then everything is saved in memory and you can access your variables instantly. Saving is also quite straight forward as all new values get just appended at the end of the file (no parsing required). For YAML you have to parse the whole file for every single value and the same again if you want to save it. If you want to get a decent performance you have to store the YAML values in variables anyway to keep them in memory. But then the variables will be saved in the .csv file as well! So every time you change something it you will have to update the YAML file and the database!

There is really no performance gain in YAML only a lot of losses. Using it for a config file is fine and should not put too much stress on the server. Using it as a custom database is just useless as you make everything slower no matter what you do.

Regarding the problem with options. You could use global variables instead and not save them in the database.
 
A large cvs file might take a while to load on server start but then everything is saved in memory and you can access your variables instantly. Saving is also quite straight forward as all new values get just appended at the end of the file (no parsing required). For YAML you have to parse the whole file for every single value and the same again if you want to save it. If you want to get a decent performance you have to store the YAML values in variables anyway to keep them in memory. But then the variables will be saved in the .csv file as well! So every time you change something it you will have to update the YAML file and the database!

There is really no performance gain in YAML only a lot of losses. Using it for a config file is fine and should not put too much stress on the server. Using it as a custom database is just useless as you make everything slower no matter what you do.

Regarding the problem with options. You could use global variables instead and not save them in the database.

This is a better explanation then the original post :emoji_thumbsup:
 
  • Like
Reactions: bi0
This is the way to go now. I thought @Rezz had made a thread on that matter, but I can't find it
So finally someone figured out how to handle yaml with skript correctly? Will this be the best way to do it, like Bukkit yaml method?
 
WARNING
If you found this on google, this thread was from an era were addons such as skript-yaml didn't exist, there's almost no difference with variables and you can probably find cases where using yaml becomes marginally faster, as long as you handle it properly.
 
  • Like
Reactions: Uzumaki
Status
Not open for further replies.