DocumentationDataMigrate ProOperation

DataMigrate ProOperation

Performance Analysis for DataMigrate Pro

The performance analysis uses extended performance logging to show which operations in DataMigrate Pro take the most time, and it flags bottlenecks.

Overview

With the extended performance logging features, you can now identify exactly which operations in DataMigrate Pro consume the most time.

What Was Added

1. PerformanceProfiler Class

  • Purpose: Collects timing data for all critical operations
  • Usage: Automatic tracking with using (PerformanceProfiler.StartTimer("Operation Name"))
  • Output: Shows a summary with total, average, minimum, and maximum times

2. DetailedPerformanceAnalyzer Class

  • Purpose: More detailed analysis with categories and bottleneck detection
  • Features:
    • Categorization by operation type
    • Bottleneck detection (operations > 1s)
    • Average time per record
    • Percentage time distribution

3. Performance Logging in Critical Areas

Metadata Resolution

C#
using (PerformanceProfiler.StartTimer($"Table Metadata Resolution - {table.TableNo}"))
{
    var info = await queryBuilder.GetTableInfoAsync(table.TableNo);
    // ...
}

Mapping Generation

C#
using (PerformanceProfiler.StartTimer($"Mapping Generation - Table {tableNo}"))
{
    // Mapping logic...
}

HTTP Uploads

C#
using (PerformanceProfiler.StartTimer($"HTTP Upload - Table {tableId}"))
{
    response = await httpClient.PostAsync(DataConnectionManager.dataEndpointUrl, requestContent);
    // ...
}

Schema Operations

C#
Logger.LogInformation($"⏱️ Schema refresh started for {tableCount} tables");
// ... operation ...
Logger.LogInformation($"⏱️ Schema refresh completed in {stopwatch.ElapsedMilliseconds}ms");

Understanding the Performance Output

1. Standard Performance Summary (📊)

Text
📊 Performance Summary:
=====================================
🔍 HTTP Upload - Table 18:
   Total: 15,234 ms (15.2s)
   Count: 5 calls
   Avg: 3046.8 ms | Min: 2100 ms | Max: 4500 ms

2. Detailed Analysis (📊 DETAILED PERFORMANCE ANALYSIS)

Text
📊 DETAILED PERFORMANCE ANALYSIS
🎯 Overall Summary:
   Total Execution Time: 45,678 ms (45.7s)
   Total Records Processed: 1,250
   Average Time per Record: 36.54 ms

📂 Data Upload
   Time: 15,234 ms (33.4%)
   Operations: 5
   Records: 1,250
   Avg Time/Record: 12.19 ms

🚨 POTENTIAL BOTTLENECKS:
⚠️  HTTP Upload - Table 18: 4,500 ms (9.9% of total time)

How to Use the Performance Analysis

1. Run the Migration

Bash
# Normale Migration mit allen Performance-Logs
DataMigratePro.exe --sourceconnectionstring "..." --targetconnectionstring "..." --sourcetableid 18

2. Find the Performance Logs

  • Search for lines with ⏱️ for individual operations
  • Search for 📊 for the summary at the end
  • Use --verbose for even more detail

3. Identify Bottlenecks

The analysis automatically shows:

  • Slowest operations (> 1 second)
  • Percentage time distribution by category
  • Time per record for throughput analysis

4. Optimization Approaches

If "Metadata Resolution" is slow:

  • Check database indexes
  • Analyze network latency to the database
  • Optimize SQL query performance

If "HTTP Upload" is slow:

  • Check network bandwidth
  • Adjust the upload batch size
  • Analyze the performance of the target server

If "Mapping Generation" is slow:

  • Use automapping vs. manual mappings
  • Prepare mapping files
  • Reduce the complexity of field mappings

Run a Performance Test

PowerShell
# Verwenden Sie das bereitgestellte Test-Script
.\test-performance.ps1

# Oder manuell:
cd "C:\Migration\DataMigratePro\Release\net8.0-windows10.0.26100.0\win-x64"
.\DataMigratePro.exe --sourceconnectionstring "..." --targetconnectionstring "..." --sourcetableid 18 --verbose

Interpreting the Results

Normal times (depending on data volume):

  • Metadata Resolution: < 100ms per table
  • Mapping Generation: < 500ms per table
  • HTTP Upload: < 1s per batch (100-1000 records)

Problematic times:

  • Metadata Resolution: > 400ms per table
  • HTTP Upload: > 5s per batch
  • Overall throughput: < 10 records/second

Troubleshooting

If performance logs do not appear:

  1. Make sure the build was successful
  2. Use --verbose for more output
  3. Check the log file in the output folder

The performance analysis helps you systematically identify and resolve the bottlenecks in your DataMigrate Pro installation!