How CodeIgniter Works?

#11
[eluser]FutureKing[/eluser]
[quote author="garymardell" date="1252167604"]For measuring the performance and benchmarking you will want to use apache ab.

http://httpd.apache.org/docs/2.0/programs/ab.html

For example to test a website you can type in terminal (command line)
Code:
ab -n 100 http://localhost:8888/garden

This will perform 100 requests, you can also specify more options like posting data aswell having more concurrent access at the same time. This is meant to simulate how well your site will perform in a real environment with users on it.[/quote]

Wow! GREAT! THANKS!

#12
[eluser]Nick Husher[/eluser]
[quote author="BrianDHall" date="1252134807"]First, doing performance measuring properly is, simply..."extremely hard". [/quote]

I'm just going to emphasize the "extremely" here. Testing a web application in a simulacrum of a real world environment is very very difficult. It's easier to have a real world environment of users to test your code's performance against to develop performance-enhancing strategies. Donald Knuth (an important computer science guy, if you don't know of him) famously said, "premature optimization is the root of all evil [in programming]." It's better to write something that's elegant, easy to write, and easy to modify now and figure out what you need to change when you start getting real traffic. A huge amount of performance can be gained just by turning on CI caching or a PHP bytecode caching solution. If you optimize your code now, you'll be doing yourself a huge disservice in six months when you realize you spent all that time for a 2% speedup when you get a 30% speedup by dropping in memcached or some other third-party solution.

#13
[eluser]GSV Sleeper Service[/eluser]
Quote:How CodeIgniter Works?
very well

#14
[eluser]BrianDHall[/eluser]
[quote author="Nick Husher" date="1252403728"][quote author="BrianDHall" date="1252134807"]First, doing performance measuring properly is, simply..."extremely hard". [/quote]

I'm just going to emphasize the "extremely" here. Testing a web application in a simulacrum of a real world environment is very very difficult. It's easier to have a real world environment of users to test your code's performance against to develop performance-enhancing strategies. Donald Knuth (an important computer science guy, if you don't know of him) famously said, "premature optimization is the root of all evil [in programming]." It's better to write something that's elegant, easy to write, and easy to modify now and figure out what you need to change when you start getting real traffic. A huge amount of performance can be gained just by turning on CI caching or a PHP bytecode caching solution. If you optimize your code now, you'll be doing yourself a huge disservice in six months when you realize you spent all that time for a 2% speedup when you get a 30% speedup by dropping in memcached or some other third-party solution.[/quote]

I shouldn't assume other people have read about premature optimization, so here's two links that are excellant on the subject: Optimization: Your Worst Enemy
and the wiki entry with references to mentioned Donald Knuth and others: When To Optimize

In short, you optimize after your system is built - not before. You don't intentionally do things that are painfully dumb, but for instance trying to use arrays instead of objects because arrays are faster ...yuck, terrible! Yet so many people suggest things of this sort, it's painful. Tiny tiny optimizations don't matter a little, they don't not matter at all - they are explicitly unredeemably bad.

#15
[eluser]jedd[/eluser]
[quote author="BrianDHall" date="1252450941"]
You don't intentionally do things that are painfully dumb, but for instance trying to use arrays instead of objects because arrays are faster ...yuck, terrible! Yet so many people suggest things of this sort, it's painful.
[/quote]

This needs a bit of an explanatory comment, I think.

#16
[eluser]BrianDHall[/eluser]
[quote author="jedd" date="1252469272"][quote author="BrianDHall" date="1252450941"]
You don't intentionally do things that are painfully dumb, but for instance trying to use arrays instead of objects because arrays are faster ...yuck, terrible! Yet so many people suggest things of this sort, it's painful.
[/quote]

This needs a bit of an explanatory comment, I think.[/quote]

Oh, this makes me recall when you mentioned you prefer arrays, sorry. No, I don't mean that using arrays are bad because you prefer them - but I mean specifically going out of your way to load things into an array hoping to gain a speed boost when using an existing object and it's methods would have worked just fine.

I can't recall the exact suggestions over the years (because I deleted as many as I could from my mind), but I've seen suggestions to avoid perfectly valid syntax and functions because it would "improve performance"...on the order of a few milliseconds per thousand loads. Things like trying to avoid use of foreach because using list was 'faster', or not using associative arrays because using single-dimension indexed arrays took less cpu cycles, or using ternary and bitwise operations that were incredibly hard to read because the function would be better now somehow because your server could now serve 10 more requests per minute...that sort of thing.

In short, you should develop quickly according to your preferences, maintenance, readability of code, etc - not trying to develop with the mind of "what will take less cpu cycles?"

I meant no offense on preferring arrays to objects - I still do too, actually. But I would take issue if you suggested using arrays for no reason other than speed of computation, directly in the face of a solution that took less lines of code, was more readable, or that used existing functions preferring to build loops manually to save a few clock cycles.

#17
[eluser]Unknown[/eluser]
Nice tutorial.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.