howdy,
anyone know if there is a significant performance difference between these options?
also, the first 2 options would be more secure, wouldnt they?
howdy,
anyone know if there is a significant performance difference between these options?
also, the first 2 options would be more secure, wouldnt they?
Include - Include and evaluate a specific file.
Unserialize - Reverse the process of serialization. Take serialized variable, make it PHP value.
Database - A relational data management structure built for speed with the ability for complex queries.
How are any of these linked? If you could give us an idea as to what you're trying to do, or what you really want answered, it'd be helpful.
any of them can be used to store information which will be used with a php script.
all i want answered is what i asked-- are any of these inherently slower than the others?
Unserialize can't store data. Unserialize is a function. Unserialize converts data from serialized form. It then stores that output in a variable in PHP. So technically, this isn't a storage system, but an interpretation construct.
Include can only store static data that can be difficult to update.
Databases are fast, and efficient when dealing with data of all types. Depending upon the table type (InnoDB, MyISAM, etc.), table structure, indexing options, (etc.) can help or hinder your speed.
Let's put it this way:
Unserialize
It can serialize what you need into one variable, but that variable value needs to be transferred via Session, Cookie, or hidden form to progress from page to page. No long term storage.
Include
Is good for things like config files, and general function keeping. Depending upon the includes, how big the file is, and what computation is needed can slow down your program (or speed it up in some cases). Pretty long term storage. Can be accidentally modified.
Database
A database is meant to move, store, and update data. It's easy to work with, efficient at what it does, and constantly improving. If you're storing things like posts, comments, photo information, letters, blogs (etc., etc.) then this is the way to go. Harder to accidentally modify parts, easy to mess up the entire system. Much more robust than any other data storage technique I've seen.
Really, what it comes down to is your needs. What do you need? What are you going to be using it for. Each has its own advantage and disadvantage in certain situations. In answer to your question: No, none are inherently slower. But that depends on many things like server speed, time of day, work-load at that specific moment. There are other factors that really go into speed. So what you should be asking is: Which of the three would be better suited for __________? That's a question that can be better answered.
Unserialize can't store data.
thank you for scrutinizing the wording of my post
and thanks for your answer.
thank you for scrutinizing the wording of my post
Not a scrutinization, but rather a clarification. Unserialize doesn't store anything, PHP does. If you start to think that unserialize (the function) actually stores stuff, eventually things can go wrong. It's better for you to understand that unserialize is an intermediate step in data interpretation.
You're welcome for the answer. Please don't forget to mark this thread resolved.
if you don't think i know the difference, why haven't you informed me that there exists a function called serialize? :bemused:
what's worse, a dumb-ass or a smart-ass?
if you don't think i know the difference, why haven't you informed me that there exists a function called serialize?
Because I figured after you read my first post, there had to be a function to serialize the data; otherwise, what good is a function without a counterpart? But since you asked: [man]serialize/man.
What's worse is the person who won't search for answers
interesting logic. the mere mention of unserialize should make me realize there exists a serialize? but i had already mentioned it. so gee golly, you should have figured i knew.
i've already read that page.. you know how i knew to search for it? the same type of function exists in other programming languages. the question i asked was not what unserialize was, i asked about performance.
include vs unserialize vs database performance?
howdy,anyone know if there is a significant performance difference between these options?
also, the first 2 options would be more secure, wouldnt they?
1.) What links them together?
any of them can be used to store information which will be used with a php script.
Sounds to me like you have no idea what each one does. So I explained what Unserialize does: it unserializes serialized information (arrays, objects, whatever). It doesn't store information like a database or an include file, or a config file, or an ini file. It only stores it in the memory for as long as the script is active, or session / cookie or form on a page sends the information.
I'm not arguing with you anymore. The reason I even asked why there was a link, is because when you compare speed, you usually want to know what it's in reference to: Storing info for a gallery, storing configuration settings for an IMAP client, storing long arrays of data or objects for a short period. Not one is inherently slow (if it were, it would be dropped and replaced by something else), and they really can't be compared because what they store are completely different. The only two that could reasonably be compared is that of a include file and a database. But even then you have to stretch to say that you want a comparison of a flat-file database versus a relational database which isn't really an include file, but a DBMS comparison.
I gave you benefit of the doubt figuring that since you knew unserialize then you would already know (with previous knowledge, searching, dumb-luck, whatever) there is a counter-part function [man]serialize[/man] which will serialize the data you want so unserialize will be able to do its thing. It's like asking what mysql_fetch_array does. You figure the person knows about mysql_query since you have to use mysql_query to use mysql_fetch_array / mysql_result ect.
Anyway, your answer has been given. End of subject. Before you flame even more, I'm closing this.