In java,which one is better for performance: Using .properties file or .conf file to read the values from these files?
In java,which one is better for performance: Using .properties file or .conf file to
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The filename extension doesn’t make a difference at all, I guess you mean the usual Java Properties format and some (but which?) other common configuration format?
All common text configuration file formats are probably similarly fast to parse. They are all quite similar, and small differences in languages usually make no difference as today’s parsers are quite good.
Even if there is a speed difference in parsing the configuration file, it won’t make a difference for you, because (hopefully!) you will parse the file only once (e.g. at application startup) or rarely at least and then use the result over a longer period of time. So in total it won’t make a difference.
Performance is not everything! Choosing a file format should focus on facts like whether it supports everything you need and want, whether it is nicely readable by humans, whether there already exist parsers for it etc. If you then find out (by measuring!) that it is too slow, you can start optimizing it. But it won’t help you to choose a file format which is fast to parse, if you find out in the end that it does not support what you need.