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

  • Home
  • SEARCH
  • 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 8897675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:24:27+00:00 2026-06-15T00:24:27+00:00

Currently I am using Microsoft Sync Framework to synchronize databases. I need to gather

  • 0

Currently I am using Microsoft Sync Framework to synchronize databases. I need to gather information per record which is inserted/updated/deleted by Microsoft Sync Framework and do something with this information.

The sync speed can go over 50.000 records per minute. So that means my additional code need to be very lightweight otherwise it will be a huge performance penalty.

Microsoft Sync Framework raises an SyncProgress event for each record. I am subscribed to that code like this:

// Assembly1
SyncProvider.SyncProgress += OnSyncProgress;
// ....
private void OnSyncProgress(object sender, DbSyncProgressEventArgs e)
{
    switch (args.Stage)
    {
        case DbSyncStage.ApplyingInserts:
            // MethodCall/Delegate/Action<>/EventHandler<> => HandleInsertedRecordInformation 
            // Do something with inserted record info
            break;
        case DbSyncStage.ApplyingUpdates:
            // MethodCall/Delegate/Action<>/EventHandler<> => HandleUpdatedRecordInformation  
            // Do something with updated record info
            break;
        case DbSyncStage.ApplyingDeletes:
            // MethodCall/Delegate/Action<>/EventHandler<> => HandleDeletedRecordInformation
            // Do something with deleted record info
            break;
    }
}

Somewhere else in another assembly I have three methods:

// Assembly2
public class SyncInformation
{
    public void HandleInsertedRecordInformation(...) {...}
    public void HandleUpdatedRecordInformation(...) {...}
    public void HandleInsertedRecordInformation(...) {...}
}

Assembly2 has a reference to Assembly1. So Assembly1 does not know anything about the existence of the SyncInformation class which need to handle the gathered information. So I have the following options to trigger this code:

  1. use events and subscribe on it in Assembly2
    1.1. EventHandler<>
    1.2. Action<>
    1.3. Delegates
  2. using dependency injection:
    public class Assembly2.SyncInformation : Assembly1.ISyncInformation
  3. Other?

I know the performance depends on:

  • OnSyncProgress
    • switch
    • using a method call, delegate, Action<> or EventHandler<>
  • Implementation of SyncInformation class

I currently don’t care about the implementation of the SyncInformation class. I am mainly focused on the OnSyncProgress method and how to call the SyncInformation methods.

So my questions are:

  • What is the most efficient approach?
  • What is the most in-efficient approach?
  • Is there a better way than using a switch in OnSyncProgress?
  • 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-15T00:24:29+00:00Added an answer on June 15, 2026 at 12:24 am

    The sync speed can go over 50.000 records per minute. So that means my additional code need to be very lightweight otherwise it will be a huge performance penalty.

    No, it won’t.

    50k / minute is not a significant number of method calls, unless you need to do thousands of such calls per record. This reeks of premature optimization. If we ignore intentionally badly written code and reflection-from-scratch-per-call, the absolute slowest way of calling a method is via untyped delegate DynamicInvoke, and that can do 50k calls in 42ms on my machine. Anything else (typed delegate Invoke, direct callvirt on a class or interface, dynamic, static call etc) will not even be measurable (as in: it will be literally 0ms for 50k calls).

    You’d do better to use a profiler to see what actually matters, IMO. It will almost certainly be the “doing” code, rather than the plumbing.

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

Sidebar

Related Questions

I'm currently using Microsoft Sync Framework and everything is working fine except the SQL
I wrote a Web service in ASP.NET using Microsoft Sync Framework 2.1 and SQL
We have been developing a hub/spoke synchronization model using Microsoft Sync Framework and WCF,
I'm currently looking to use Microsoft Sync Framework (2.1) to sync clients (running SQL
I am writing a program that generates excel reports, currently using the Microsoft.Interop.Excel reference.
I am currently in the process of creating API documentation using Microsoft Word 2007
I'm using the Format function ( http://msdn.microsoft.com/en-us/library/59bz1f0h%28v=vs.90%29.aspx ) to format my output. Currently I
I am currently using Microsoft's chart control - the MSDN documentation for it is
I am currently using the LimitedConcurrencyLevelTaskScheduler detailed here http://msdn.microsoft.com/en-us/library/ee789351.aspx I want to enhance this
I am currently using Microsoft Chart Controls to generate a box plot chart. 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.