Application VERY SLOW

15 views
Skip to first unread message

Emad Ibrahim

unread,
Dec 22, 2009, 8:09:13 PM12/22/09
to nhprof
I have a very fast machine but the app is running extremely SLOW. I
am not doing anything unusual like load testing and I only have one
session open with about 600 statements...

resize, selecting alerts, switching tabs, right click, menus,
everything is SOOOO slow. It is very painful.

If I can get this to run at a reasonable speed, I can't imaging how I
would live without it. It is simply amazing but please, give me some
tips on how to fix.

Windows 7,
VS 2k8
Windows Forms app.

Ayende Rahien

unread,
Dec 23, 2009, 3:25:32 AM12/23/09
to nhp...@googlegroups.com
What build are you using?
Are you running in a VM?
Is the app using a lot of CPU / memory?
Try turning off hardware acceleration and see it this help.

> --
>
> You received this message because you are subscribed to the Google Groups "nhprof" group.
> To post to this group, send email to nhp...@googlegroups.com.
> To unsubscribe from this group, send email to nhprof+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nhprof?hl=en.
>
>
>

Jason Meckley

unread,
Dec 23, 2009, 11:01:25 AM12/23/09
to nhprof
1 session with 600 statements? maybe the application you are
monitoring is slow, which appears to make NHProf slow.
I did a presentation on NH and found that NHProf would lag behind when
loading the dummy data, which was hundreds records. And i figure if
nhprof is slow at processing the statements, then I should consider
this a potential bottleneck with my system.

Mike Nichols

unread,
Dec 23, 2009, 11:59:25 AM12/23/09
to nhp...@googlegroups.com
I have build 590 on a VM on win 2K3 and have problems with the app eating up loads of CPU. I do have a session with hundreds of statements but that is the DROP/CREATE  session...not sure how to get around that. I tried build 589 and still had issues. I thot maybe I had different versions of the appender or something but checked setup out and it is normal. I'll try to recreate and do a dump to file.

Eric W. Brown

unread,
Dec 23, 2009, 12:37:09 PM12/23/09
to nhp...@googlegroups.com

 

I have a minor suggestion to improve the usefulness of this list.

 

Can the google group be adjusted so that it puts a token at the front of each email message?

 

Say [NHPROF], so messages from this group can be sorted into a separate folder.

 

I’m on other lists and even other Google groups, and they all do it, this is the only exception …

 

Thanks,

 

Eric-

Ayende Rahien

unread,
Dec 23, 2009, 4:06:56 PM12/23/09
to nhp...@googlegroups.com
Mike,
Can you try build 592 ? It contains a lot of perf fixes.

On the VM, please disable hardware acceleration, it is known issue
with WPF apps on certain VM platforms.

Ayende Rahien

unread,
Dec 23, 2009, 4:07:07 PM12/23/09
to nhp...@googlegroups.com
Well, that should be fixed now, I hope :-)

Ayende Rahien

unread,
Dec 23, 2009, 4:08:12 PM12/23/09
to nhp...@googlegroups.com
Done

Mike Nichols

unread,
Dec 23, 2009, 5:34:47 PM12/23/09
to nhp...@googlegroups.com
I tried 592 and it did seem better but then wouldnt let nhprof get focus. I'll try to find where to disable acceleration in vmware.

Emad Ibrahim

unread,
Dec 24, 2009, 6:25:45 AM12/24/09
to nhprof
Build 590.

NOT in VM

CPU usage around 30%

PS: I just installed 592 - seems a little faster...

Ayende Rahien

unread,
Dec 24, 2009, 6:42:12 AM12/24/09
to nhp...@googlegroups.com
Can you try disabling hardware accel anyway? I am just trying to rule out stuff that might cause it outside of my control

Mike Nichols

unread,
Dec 27, 2009, 11:28:38 AM12/27/09
to nhp...@googlegroups.com
Hey Oren
Just wanted you to know I disabled acceleration (dxdiag.exe in case anyone is reading this) inside the VM on build 592 and things seem to have improved. Initially there is a lengthy delay for the app to get focus when I am running tests but I expect that. Otherwise performance has improved alot.
I do have one question about schema exports and how sessions are identified. Each time a schema export is done during the test init by nh it appears in the same session...so the number of statements reaches into the thousands quickly for that one session. I have a test fixture (below) that does the schema export before tests are run...each SchemaExport call is in Session#1 according to NHProf...is that normal? Does Configuration have a session it does work in and since my configuration reference is static it will always appear in that session?


    public class InMemoryDbFixture : WithDebugging,IDisposable
    {
        private static Configuration configuration;

        public InMemoryDbFixture()
        {
            NHibernateProfiler.Initialize();
            if (configuration == null)
            {
                configuration = new Configuration();
                string connectionString = string.Format("Data Source={0};Version=3;New=True;", "MaterialsTesting_Test");
                configuration
                    .SetProperty(Environment.SessionFactoryName,"reporting_test")
                    .SetProperty(Environment.DefaultEntityMode, "poco")
                    .SetProperty(Environment.Dialect, typeof (SQLiteDialect).AssemblyQualifiedName)
                    .SetProperty(Environment.ConnectionDriver, typeof (SQLite20Driver).AssemblyQualifiedName)
                    .SetProperty(Environment.ConnectionString, connectionString)
                    .SetProperty(Environment.ProxyFactoryFactoryClass, typeof (ProxyFactoryFactory).AssemblyQualifiedName)
                    .SetProperty(Environment.GenerateStatistics, "true");
                configuration.AddAssembly(typeof (ReportingModelLocator).Assembly);
                configuration.AddAssembly(GetType().Assembly);
                SessionFactory = configuration.BuildSessionFactory();
               
            }
            Rebuild();
            Session = SessionFactory.OpenSession();
            Session.FlushMode = FlushMode.Commit;
        }

        public static ISessionFactory SessionFactory { get; private set; }
        public ISession Session { get; private set; }

        public virtual void Dispose()
        {
            Session.Dispose();
            Session = null;
//            ProfilerInfrastructure.FlushAllMessages();
        }

        public void Rebuild()
        {
            new SchemaExport(configuration).Execute(false, true, false);

Ayende Rahien

unread,
Dec 27, 2009, 12:13:27 PM12/27/09
to nhp...@googlegroups.com
First time the profiler starts, there is some time spent prepping the sql parsing. That can be up to 10 - 15 seconds, but it is a one time cost.
Does this match your experience?

For SchemaExport, it has no session, so NHibernate falls back to the "default" session, which is the current thread.
I'll add some code that will add time aspect to it.

Mike Nichols

unread,
Dec 27, 2009, 12:55:26 PM12/27/09
to nhp...@googlegroups.com
>Does this match your experience?
Yes I believe so
Reply all
Reply to author
Forward
0 new messages