What would be the best config format for a huge (60KB+ when compressed) plugin? - YAML (.yml) - JSON (.json) - ENUM (.txt) really? - PHP (.php)
What would be the best way to figure it out? Maybe testing it yourself? Be adventurous! You can try YAML, that should work. Maybe JSON is faster, maybe not. How about a TXT file? Oh PHP is also possible. I hope this info helps
Config format? What are you storing? If player data, I would go with SQLite (I use it a lot recently). But seriously, I don't get why people use config files to store data. For other stuff, JSON and XML are also options you should consider.
Thanks for the replies (OMG Intyre replied!!!) @Legoboy0215 : Well, PeMapModder had some supportive stuff to say about MySQL and MySQL Queries. Maybe because MySQL (obviously) runs parallel with PocketMine. SQLite3...well why not...but I'd go with MySQL because my future plan is to have a MySQL server running on a completely different system and PocketMine servers on another.
Speaking of testing it out myself. I did test them out and there wasn't any huge difference between YAML and JSON (0.0001 diff, tried setting and getting 300 values in an array). I still have to test SQLite and MySQL.
I'm focusing on performance btw. I'm the kind of guy who'd compile config.php into config.phar and use it as a config if that's gonna increase performance.
For what? Player data? If so, a database (.db) or SQLite. also ah, .txt? it's not perfect and a .php is good too, using include, but not very good for users that don't know PHP.
That doesn't matter if you don't read/save the file constantly on runtime. You usually cache the config to memory and use it as array. After you've done you're job, save the cache to config file and performance won't be trouble. PHP: private $config;// Load the config only once onEnable$this->config = new Config("config.file", Config::DETECT);// get the key$this->config->get("key"); Instead of reloading the config everytime you use it PHP: (new Config("config.file", Config::DETECT))->get("key");
What about testing how fast what workss PHP: $beginTime = microtime(true)//$cfg = new Config("config.TestAllVariants", Config::TestAllVariants)$cfg->save()$cfg->set(array("test" => 1, "test2" => -19429));$cfg->save()$finalTime = - $beginTime - microtime(true);echo("Done! Took ".$finalTime."ms.");
there ambiguity here just because a plugin is big it doesn't mean it will take up a big config space BTW you can also use PHP sterilize SQLITE3 or just make your own config model (by exploding | as separator or something you can be creative)