Stored as induvidual or in one file?

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

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Jan 27, 2017
38
5
8
Hello!

I've a simple question, who doesn't need "help format"...

Is it better to have data stored in one file or seperate? On event "chunk change" I'm checking if "chunk is set" in my file, so there is a lot of checking evolved for all players in server.

So is it better to have those chunks set in one file (skript will try to find a specific chunk through hundreds, even thousands of lines in file) or have every "setted chunk" stored as separate file in a some folder?

An example: My current situation - in one file
Code:
Data:
  chunk (-16,-20) of world: data1
  chunk (-12,12) of world: data1
  chunk (-12,13) of world: data1
  chunk (-12,10) of world: data2
  chunk (-12,9) of world: data3

So in every chunk change skript checks if chunk is one of those setted chunks.

In other possible way every line in my example would be in separete file like

"chunk (-16,-20) of world.yml" in that file one word data1..
 
It depends, it might take skript a while to check through thousands of lines in a single file however then it'll be more organised if it's all in one file, i say maybe split the file after the line count is like greater than 1000 or something.
 
It depends, it might take skript a while to check through thousands of lines in a single file however then it'll be more organised if it's all in one file, i say maybe split the file after the line count is like greater than 1000 or something.
So it would be faster for skript to find a file with a specific name through 1000 files than a 1000 line one file?
 
Honestly couldn't tell you mate, do some tests yourself and see whats faster
 
I did some testing and found out that using seperate files is a bit better. I ran a "scan function" that checked 81 chunks around me 30 times, and checked if those chunks mached one of my already set chunks in file OR if such chunk.yml exists in my predifined folder. When everything was in one file, TPS dropped to about 19.58, but when they were seperately, TPS didn't change at all (stayed at 20). So I guess I'll use this for now, hope this will help others too.

P.S. Basically I did the same function, but my predifined data was 1. stored in one file; 2. stored seperately in each file. Faster checking was to match corresponding file, than a check one file.
 
I did some testing and found out that using seperate files is a bit better. I ran a "scan function" that checked 81 chunks around me 30 times, and checked if those chunks mached one of my already set chunks in file OR if such chunk.yml exists in my predifined folder. When everything was in one file, TPS dropped to about 19.58, but when they were seperately, TPS didn't change at all (stayed at 20). So I guess I'll use this for now, hope this will help others too.

P.S. Basically I did the same function, but my predifined data was 1. stored in one file; 2. stored seperately in each file. Faster checking was to match corresponding file, than a check one file.

THE best way you can do this is writing iT al in 1 line. So iT would look like 'chunk1|chunk2|chunk3' THEn just pull this 1 line And split iT at | THE only thing is that iT Will a mess. But if i need To choose between these 2 i would choose seperat files
 
THE best way you can do this is writing iT al in 1 line. So iT would look like 'chunk1|chunk2|chunk3' THEn just pull this 1 line And split iT at | THE only thing is that iT Will a mess. But if i need To choose between these 2 i would choose seperat files
No? doesn't matter if you put it on 1 line or 100 lines, the file size will still be the same, having it on 1 line means you have to put it into a variable, this creating even more space and then skript then has to work out how to split it, this using memory space.
 
Status
Not open for further replies.