Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8487153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:09:18+00:00 2026-06-10T21:09:18+00:00

i have a performance issue with NHibernate 3.3 and Firebird 2.5.1. I created a

  • 0

i have a performance issue with NHibernate 3.3 and Firebird 2.5.1. I created a very simple example with ASP.NET MVC and a local (!) Firebird Database.
But following Code takes about 1sec for execution ?!?

        var startTickCountWrite = Environment.TickCount;

        IRepository<Project> repository = facade.ProjectRepository(null);
        for (int i = 1; i <= 250; ++i)
        {
            var myProject = new Project { ProjectId = i };
            repository.Insert(myProject);
        }
        repository.Commit();

        var endTickCountWrite = Environment.TickCount;

If I place the commit() inside the for-loop it takes about 5sec!

Behind Repository and facade is nothing special. I just forward the Project to ISession.Insert.

Project has only ID and ProjectID as properties.

Can anyone tell me whats going wrong?

Thanks,
Andreas

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:09:20+00:00Added an answer on June 10, 2026 at 9:09 pm

    250 objects in 1 second does not sound shockingly slow. For evaluating performance it would also be good to provide some comparison – how long does it take to execute the same amount of SQL directly against Firebird?

    NHibernate can in some circumstances batch INSERT statements, but I don’t know if this works on Firebird. http://nhibernate.info/doc/nh/en/index.html#performance-batch-updates The choice of identity generator can also have an effect. Some generators force NHibernate to execute the INSERT statement immediately, which will prevent the use of batching.

    From a design point of view you might want to change some things:
    IRepository.Insert() is typically named Add(), since it mimics a collection interface (and Insert on collections, if present, usually take an index parameter which is not relevant here of course). Also, Commit() seems out-of-place on the repository, since you will typically have multiple repository instances involved, that share the same transaction and session.

    For accurate time measurements, you can use Stopwatch from System.Diagnostics, so you don’t need to convert the value yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several performance issue in my website. I'm using asp.net mvc 2 and
I have performance issue in asp.net page between InitializeCulture and Page_PreInit event. When I
I have an asp.net-mvc3 website using nhibernate and SQL server. I have 2 web
I have a performance issue regarding a quite simple query that run for more
They have all different sizes but how about performance issue between each other ?
I have a performance issue with the WPF DataGrid (.net 4.0) first, some details:
I currently have an application, where it's primary performance issue is using file-based database
i have a performance issue in my tableview my cellForRow looks like that: if
Just like in this topic , I have a performance issue in dev mode
I've got an performance issue in my application using a MSSQL DB. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.