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 6145821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:51:13+00:00 2026-05-23T18:51:13+00:00

We currently use List<T> to store events from a simulation project we are running.

  • 0

We currently use List<T> to store events from a simulation project we are running. We need to optimise memory utilisation and the time it takes to process the events in order to derive certain key metrics.

We thought of moving the event log to a SQL Server Compact database table and then possibly use Linq to calculate the metrics. From your experience do you think it will be faster to use SQL Server Compact than C#’s built-in data structures or are we going to have issues?

  • 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-05-23T18:51:13+00:00Added an answer on May 23, 2026 at 6:51 pm

    Some ideas.

    MSMQ (Microsoft Message Queue)

    You can have a thread dequeueing off of MSMQ and updating metrics on the fly. If you need to store these events for later paroosal you can put them into the database as you dequeue them. MSMQ demonstrates much better scalability in these scenarios – especially when the publisher and subscriber have assymetric processing speeds; and binary data is being used (as SQL can get bogged down with allocating space for VARBINARY, or allocating/splitting pages for indexes).

    The two other SQL scenarios are complimentary to this one – you can still use dequeueing to insert into SQL; to avoid any hiccups in your simulation while SQL allocates space.

    You can side-step what @Aliostad said using this one, to a certain degree.

    OLAP (Online Analytical Processing)

    Sounds like you might benefit from from OLAP (cubes etc.). This will increase the overall runtime of your simulation but will improve the value of the data. Unfortunately this means forking out cash for one of the bigger SQL editions.

    Stored Procedures

    While Linq-to-SQL is great for ‘your average developer’ please keep away from it in scientific projects. There are a host of great tricks you can use in raw TSQL, in addition to being able to inspect the query plan. If you want the best possible performance plan your DB carefully and create stored procedures/UDFs to aggregate your data.

    If you can only calculate some of the metrics in C#, do as much work in SQL before-hand – and then feel free to use Linq-to-SQL to grab the data.

    Also remember if you are inserting off the end of a MSMQ you can agressively index, which will speed up your metric calculations without impacting your simulation.

    I would only involve SQL if there is a real need for better memory utilization (i.e. you are actually running out of it).

    Memory Mapped Files

    This allows you to offset memory pressure onto disk; at a performance penalty if it needs to be ‘paged’ back in.

    Overall

    I could steer clear of Linq to define basic metrics – do it in SQL. MSMQ is without a doubt a huge winner in this case. Don’t overcomplicate the memory issue and keep it in .Net if you are not running out of memory.

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

Sidebar

Related Questions

Is there a way in Python to list all the currently in-use drive letters
I currently use a DataTable to get results from a database which I can
I need to display upcoming events from a database. The problem is when I
Currently, we use a giant configuration object that is serialized to/from XML. This has
I currently have a class that uses the KeyValuePair with List to store a
I have several chat rooms. Currently, I store the list of chat users in
In an algorithm I'm currently implementing, I need to manipulate a std::list of struct
My entities currently contain java Date properties. I'm starting to use Joda Time for
In .NET which data type do you use to store list of strings ?
In my program I often use collections to store lists of objects. Currently I

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.