Question

That´s a general question. I need do retrieve the value of about 20 strings of about 100 characters each. Which of the following methods would be the quickest, in order to retrieve the variables?

1) reading from a separate include file, where the variables values are assigned (e.g. $var1 = "blablablah...."; etc) 2) reading from a text file 3) reading from a (small) database - e.g. doing a simple mysql query

And what about a slightly larger case, e.g. about 50 strings up to 300 characters each?

Thank you

Was it helpful?

Solution

Which of the following methods would be the quickest, in order to retrieve the variables?

1) reading from a separate include file

And what about a slightly larger case, e.g. about 50 strings up to 300 characters each?

1) reading from a separate include file

It really depends on how much you value performance over practicality.

OTHER TIPS

You've not included how many of these strings exist in your data set in total, and how often they're updated.

Using a wholly PHP-based solution or disc-files solution is fine when there are only a few of them and they're rarely updated; it becomes a management nightmare when there are 1bn and they get updated at a rate of thousands per minute.

Start with the most obvious (most maintainable) solution then optimise once performance becomes a problem and you're sure that's the source of it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top