Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Query Builder Efficiency #2456
There are some parts in the new query builder that seem to be a lot of overhead for something that doesn't seem to need all of that overhead.
For example, on
In fact, if you think about CodeIgniter in relation to every other php framework out there, it's lacking features in the Database arena e.g. most other frameworks offer an ORM, and have more db helper functions. But if we could market the fact that CI's query builder has been streamlined to make sure that your CI application will have a light footprint and incredible speed compared to other monolithic application, then we have a selling point that'll make CI's db arena as relevant to other php frameworks.
IMHO, the database drivers and libraries a framework offers are one of the most essential items a framework can offer because any web application worth anything will use persistent storage.
Items in the
Improving the query builder is a nice thought, but just saying that it needs to be done isn't going to make anything happen. You have to be proactive with things like this. If anything, quote specific chunks of code that you're unsure about, or you think can be improved. Or, even better, submit some improvements yourself.
I doubt anybody would be against improving the query builder, if the submitted code was actually an improvement (which is useful for more than just a select few users, naturally). Discussion and ideas are encouraged (at least I encourage it -- I'm not a representative for this repo).
If you do plan on submitting code, though, make sure to do it in chunks. Don't radically modify many parts of the query builder and submit it all at once. It's far too difficult to review and test. Focus on one thing and make it as good as you can.
K, I've been doing some profiling on my machine, and I've come up with two quick fixes that should help some.
With that said though, there are functions like
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
The thing is, EVERYBODY has an issue with the QB - some want to write
You don't get such features without sacrificing some performance and especially not by working exclusively with strings. It might be possible if you're a God-like regexp ninja, but it sure doesn't come easy even then. There's no use of discussing this - it's one of the things that if are to be done, somebody must just go ahead and do them ALL, end-to-end. I'm a performance-oriented guy myself, so don't worry about whether we want it to be faster or not - of course we do. :)