quinnsu / SqlCE-Wmi-Test

efficiency test of SqlCE and Wmi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SqlCE-Wmi-Test

1. Efficiency of SQL CE compared with WMI (currently used)

[Test Data]

WMI

class PluginExecuteMetrics
{
	[key] string PluginId;
	string PluginName;
	uint32 ExecuteTotalCount;
	uint32 ExecuteExceptionCount;
	uint64 ExecuteMinDuration;
	uint64 ExecuteAvgDuration;
	uint64 ExecuteMaxDuration;
};

SQL CE

class PluginExecuteMetrics
{
	[key] string PluginId;
	string PluginName;
	INT ExecuteTotalCount;
	INT ExecuteExceptionCount;
	BIGINT ExecuteMinDuration;
	BIGINT ExecuteAvgDuration;
	BIGINT ExecuteMaxDuration;
}

Notice:

  • Pluginid is generated randomly using Guid.NewGuid()
  • PluginName and int are default value.
  • using System.Data.SqlServerCe and System.Management

[EXAMPLE]

insert 5000 plugin metrics execute result into SQL CE table (with random PluginId and default count) result: image

insert 5000 plugin metrics execute result into WMI table(with random PluginId and default count) result: image

[INSERT]

image

[DELETE]

image

[UPDATE]

image

[SEARCH]

image

2.availability

[schema changed]

SQL CE

  • still available when add/drop/alter a column
  • using sql "ALTER TABLE ADD/DROP/ALTER COLUMN" ( no data in this column)

WMI

  • needs to compile the MOF file (no instance in this class)

3.Install on Client's PC

  • SQL CE needs an extra .exe installation package on client's PC.
  • 2.5MB SSCERuntime-ENU.msi
  • msi package With WiX : 34KB(original test code) -> 2.49MB

4.Feasibility

5.Other choices

  • Firebird Embedded
  • SQLite
  • TurboSQL

6.CPU Usage

Notice

  • both use Resource Monitor to check the avg CPU usage
  • the whole .exe file includes create database and insert/update/search/delete operation(5000 times each) and a Console output

SQLCE : 12%

WMI :6.5%

7.Memory Usage

Notice

  • both use System.Diagnostics.Process.PeakWorkingSet
  • the whole .exe file includes create database and insert/update/search/delete operation(5000 times each) and a Console output

SQLCE : 69MB

WMI :30.2MB

conclusion: The CPU/Memory Usage of Wmi is obviously better than SQLCE.

About

efficiency test of SqlCE and Wmi


Languages

Language:C# 100.0%