Skip to content
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

ActiveRecord objects are too fat #249

Open
msugakov opened this issue Dec 27, 2010 · 0 comments
Open

ActiveRecord objects are too fat #249

msugakov opened this issue Dec 27, 2010 · 0 comments

Comments

@msugakov
Copy link

Hello
I've been trying to implement batch processing operations using SubSonic 3.0.0.4 and ActiveRecord pattern. Loading of 100k objects from database quickly ate 2Gb of RAM. Then I ran a test example:

create table ActiveRecordTest ( Field int )

then

class Program
{
    static void Main(string[] args)
    {
        int N = 10000;
        long before = Process.GetCurrentProcess().WorkingSet64;
        ActiveRecordTest[] array = new ActiveRecordTest[N];
        for (int i = 0; i < N; ++i)
            array[i] = new ActiveRecordTest();
        long after = Process.GetCurrentProcess().WorkingSet64;
        Console.WriteLine("Usage: {0} bytes. Per object (inaccurate): {1} bytes/object", after-before, (after-before)/N);
        return;
    }
}

Results of running this on my system say that there's too big overhead:

Usage: 216301568 bytes. Per object (inaccurate): 21630 bytes/object

I hope that fixing this will improve SubSonic scalability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant