Welcome Guest, Not a member yet? Register   Sign In
ActiveRecord inspired ORM
#12

[eluser]m4rw3r[/eluser]
Ok, I'm terribly sorry, I made an error when I was testing my ORM. I thought I had both models set to has_many (in thread) and belongs_to (in post), but instead I had a has_and_belongs_to_many in the post model :red: .
So that's not really a fair competition, a belongs_to relationship vs a has_and_belongs_to_many relationship (one more query and a little more PHP).

So I remade the test:
The same code as last time (except the change of the post model):

Code:
ORM        5.0832
CI AR      4.8359

Result: My code is about only 5.11 % slower!! :-) (A great increase in performance, really shows the difference between has_many and has_and_belongs_to_many)

While I was at it, I made a test of memory consumption:
The same code, but commented the one I wasn't testing, then I copied the value from the profiler.

Code:
ORM      2,612,520 bytes
CI AR    2,223,888 bytes

Result: My ORM uses about 17.47 % more memory (400 kb more, I think that can be lowered by using more references, but some of that memory are for the compiled classes, I believe)

BTW, This model works like a factory, where all child classes have a reference to the object who created them, by using that pattern I only have one model for many records and not much in the actual ORM_records (a few methods, the row data, uid and related objects (when they are loaded)).

So, now I have to work on the behaviours (suggestions, ideas, etc. are welcome).


Messages In This Thread
ActiveRecord inspired ORM - by El Forum - 04-05-2008, 12:50 PM
ActiveRecord inspired ORM - by El Forum - 04-05-2008, 02:29 PM
ActiveRecord inspired ORM - by El Forum - 04-06-2008, 06:35 AM
ActiveRecord inspired ORM - by El Forum - 04-06-2008, 09:13 AM
ActiveRecord inspired ORM - by El Forum - 04-07-2008, 03:27 AM
ActiveRecord inspired ORM - by El Forum - 04-07-2008, 07:01 AM
ActiveRecord inspired ORM - by El Forum - 04-08-2008, 06:14 AM
ActiveRecord inspired ORM - by El Forum - 04-08-2008, 09:32 AM
ActiveRecord inspired ORM - by El Forum - 04-10-2008, 05:25 AM
ActiveRecord inspired ORM - by El Forum - 04-10-2008, 05:54 AM
ActiveRecord inspired ORM - by El Forum - 04-10-2008, 06:00 AM
ActiveRecord inspired ORM - by El Forum - 04-10-2008, 07:22 AM
ActiveRecord inspired ORM - by El Forum - 04-19-2008, 04:15 AM
ActiveRecord inspired ORM - by El Forum - 04-22-2008, 10:23 PM
ActiveRecord inspired ORM - by El Forum - 04-23-2008, 12:58 AM
ActiveRecord inspired ORM - by El Forum - 04-23-2008, 11:04 AM
ActiveRecord inspired ORM - by El Forum - 04-23-2008, 09:08 PM
ActiveRecord inspired ORM - by El Forum - 04-24-2008, 02:43 AM
ActiveRecord inspired ORM - by El Forum - 04-24-2008, 03:29 AM
ActiveRecord inspired ORM - by El Forum - 04-24-2008, 11:26 AM
ActiveRecord inspired ORM - by El Forum - 04-24-2008, 12:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB