-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Import global classes but fully qualify functions and constants #4899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I need @lonnieezell to weigh in. I'm too torn - I hate the preceding slashes but I know it is a performance gain. |
1208709
to
db12873
Compare
8c98cdc
to
e514418
Compare
@paulbalandan Are you able to run any benchmarks comparing this branch with the optimizations to a version of the framework without? I'm very curious what the gain actually is. I agree with @MGatner that I'm not a huge fan of the slashes. This feels almost like a premature optimization, but I could be off base. CodeIgniter isn't exactly slow right now, with the possible exception of the database layer. I feel there is probably room for optimizations there. |
I'm not sure how to proceed with benchmarking. Never did that before. Do you know of a tool or reference I can try out? |
Ok. Found a way to bench this with ApacheBench. Will send the results later. |
e514418
to
1fb5be9
Compare
Oh, glad you found a way to test! I haven't really done any testing large scale either. I'm very curious to see what the results are. |
OK, here are the results with Apache Bench Some caveats with the benchmarks:
EnvironmentOS: Windows 10 Home Single Language 19043.1110 Steps:
Metrics usedA: Requests per second (#/sec) ResultsThe following are the results of running
Results using
|
Wow this is awesome! Thanks @paulbalandan. I can run on a dedicated server if anyone is suspicious of laptop results, but to me this seems to show: a) there is a noticeable performance difference, and b) it isn't large enough to dictate our style choices. I'm still not opposed to applying this but I think in the realm of optimization there are a lot of other changes we could make for higher gains. |
I ran this on a dedicated server but my results never stabilized. I followed our process, only thing I didn't know how to do was "Delete also the files generated by opcache." Attempt 1
Attempt 2
Attempt 3
Attempt 4
Attempt 5
Attempt 6
|
@MGatner which of these is a baseline without the updates? Or are all of these the optimized branch? |
Those are all on |
Since you're using a server already, try using a live address instead of localhost (via The "Delete files generated by opcache" is found in this ini setting |
I tried this again, using the live server instead of |
|
|
Weird. I would not have expected those results. I actually expected there not to be much change but the new stuff is 1/2 as fast? |
Like I said I can only assume that something is wrong. These are tools I am not familiar with but that cannot possibly be accurate! |
My benchmarking solution isn't ready to unveil yet but I did run these two branch through what I have so far. The proposed
So maybe there is something else going on here? EDIT: Nevermind, I was reading it wrong! The deviation is much worse, but the average execution time improves ~8%, which seems more ballpark like what we are after. |
Yeah, I'm not really sure what's causing the numbers - but I don't think this one should hold up a release. Not sure what else is needed before the next release, though, honestly. |
|
If that's the case, here is my proposal:
|
I'm amenable to the proposal. My concern only is on point 2. The name is currently taken by the CS based on codesniffer, so I'm thinking |
I'm proposing we use the newly-acquired organization "codeigniter/" (no "4"). Since this will ultimately be our style rules for all CodeIgniter projects, and the eventual goal is to host them out of that organization, this seems like a good first candidate. @lonnieezell ? |
I am fine with this. As we had discussed elsewhere moving everything to that org come version 5, anyway. I don't see a need for a new set of style rules then so this is a perfect first candidate. :) |
Sounds good! Yes normally I would wait for version 5 but because of the conflict Paul mentioned I think this is best. @lonnieezell can you make sure the team has organization access to GitHub.com/codeigniter? Or at least just me for now so I can create the repo? |
@MGatner I think everyone has been invited now. |
Alright, on to it. |
Closing this for now. The cost of resolving merge conflicts and maintaining PR up to date with latest develop is way too much than its perceived benefits. I can just recreate this when the time comes. |
Description
An alternative approach to #4890, which I am using in my libraries (except for the import part).
Strategy:
use
statements.DIRECTORY_SEPARATOR, PHP_VERSION_ID, PHP_SAPI, PHP_INT_SIZE
as frequently used. (This one is debatable)Checklist: