日期:2014-05-20 浏览次数:20898 次
[fastCSharp.setup.cSharp.memoryDatabase(CacheType = typeof(fastCSharp.memoryDatabase.cache.identityArray<,>), FileName = null, MinRefreshSize = 1, MaxLogCacheSize = 0, ClientPoolType = typeof(clientPool), IsEmbed = false, IsJsonSerialize = false)]对于代码生成模式,数据库操作代理就是 Model.memoryDatabase.Default,比如
private static memoryDatabase db = memoryDatabase.Default;对于反射模式,数据库操作代理需要自己创建。嵌入模式与远程模式的数据库代理分别如下
private static fastCSharp.setup.cSharp.memoryDatabase.localTable<identity, int> db = fastCSharp.setup.cSharp.memoryDatabase.table.Open(new setup.cSharp.memoryDatabase.localTable<identity, int>(new fastCSharp.memoryDatabase.cache.identityArray<identity>()));
private static fastCSharp.setup.cSharp.memoryDatabase.remoteTable<identity, int> db = fastCSharp.setup.cSharp.memoryDatabase.table.Open(new setup.cSharp.memoryDatabase.remoteTable<identity, int>(new clientPool(), new fastCSharp.memoryDatabase.cache.identityArray<identity>()));性能测试,采用的数据定义如下
public abstract class data当成员String为null的时候,二进制序列化数据大概120+字节,Unicode编码的JSON序列化数据大概580+字节。
{
public bool Bool;
public byte Byte;
public sbyte SByte;
public short Short;
public ushort UShort;
public int Int;
public uint UInt;
public long Long;
public ulong ULong;
public DateTime DateTime;
public float Float;
public double Double;
public decimal Decimal;
public Guid Guid;
public char Char;
public string String;
public bool? BoolNull;
public byte? ByteNull;
public sbyte? SByteNull;
public short? ShortNull;
public ushort? UShortNull;
public int? IntNull;
public uint? UIntNull;
public long? LongNull;
public ulong? ULongNull;
public DateTime? DateTimeNull;
public float? FloatNull;
public double? DoubleNull;
public decimal? DecimalNull;
public Guid? GuidNull;
public char? CharNull;
}