Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I know some people store settings in an .ini file and get the values with parse_ini_file() in PHP. Without running tests, I am curious about performance.

Do you know if opcode cache can cache any of this type of stuff if setting are in an ini file?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
668 views
Welcome To Ask or Share your Answers For Others

1 Answer

According to this old blog post retrieved from web archives.

From fastest to slowest:

  1. Serialized arrays
  2. Plain PHP code
  3. INI files
  4. XML files
  5. YAML files

EDIT (08/02/2012)

If APC or other accelerator is available on the server plain PHP files would be the fastest due to fact that they will be parsed only once and kept in memory for further use.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...