CodeIgniter Forums

Full Version: question about CI abilities
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]hueman[/eluser]
hi friends
first i apologize for my english level
i am newbie with CI and very interested to knowing more about CI abilities
i am trying to build a great web application, now i am testing some famous php frameworks to choose best
my primary question about CI is:
is CI able to run great projects with thousands visits per hour?
thank you for share your experiments

El Forum

[eluser]mddd[/eluser]
CI has a low performance footprint, compared to many other frameworks. It can be very efficient, especially if you take care not to load unneccessary stuff and use caching to your advantage.

Ultimately, no matter which framework you use, effiency is mostly in your own hands. But CI is definitely not going to be a burden for performance.

El Forum

[eluser]venugopal[/eluser]
CI is good for simple projects. Somehow I feel It doesnt allow you to use Abstraction,Inheritance, Polymorphism to their capabilities.
I was unable to implement Polymorphism in my model layer.

El Forum

[eluser]WanWizard[/eluser]
Does that say something about CI, the general lack of support for it in PHP, or about your programming skills?

Back to the question:

One of my bigger sites gets over 15M requests a month, with days over 750.000 hits (between 8-22h). CI handles that with two fingers up its nose, using a local MySQL DB on a 2Gb Quad-core server. Performance is I/O bound, so CI is handly a factor in the response time.

The only issue I still have is memory consumption, but that is largely my fault. I use a lot of core extensions, which basically means you load a lot of code that is not used (because it is overloaded). Also, my models are quite bloated at the moment, which means I load 1500 lines of code when I only need a single method from that model.

El Forum

[eluser]venugopal[/eluser]
Can you show me how do you implement this

My Model should be like this
----------------------------
Abstract_model extends Model
Derived_model_1 extends Abstract_model
Derived_model_2 extends Abstract_model

In my controller
----------------
$this->load->model('abstract_model',$config);

and I should be able to use

$this->abstract_base_class->function_in_derived_model_1();
or
$this->abstract_base_class->function_in_derived_model_2();

I wanted to achieve dynamic polymorphism here...Wondering how to do? May be you are right in questioning my programming capabilities Smile

El Forum

[eluser]venugopal[/eluser]
Please say anything other than CI is PHP4 and not PHP5. If its the case, CI is lot behind the real world

El Forum

[eluser]WanWizard[/eluser]
You can do that in CI, you only have to make sure your abstract model is loaded before you load one of the derived models.

But you can't do in PHP what you want to. PHP is weak typed, and therefore will never support polymorphism like implemented in languages like C++ or Java.

To access a method() in Derived_model_1, you have to use $this->Derived_model_1->method().

You can work around that by using $this->abstract_class->my_method( $this->derived_model_2 ) which then calls $this->derived_model_2->my_method(), but it's a clumsy workaround.