In java,which one is better for performance: Using .properties file or .conf file to read the values from these files?
No difference. In both cases open and read the file.
And your properties file is probably not more than a few hundreds of lines.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With