SmartSql 高性能、超轻量级的 ORM 项目简介
简介Why拥抱跨平台 DotNet Core,是时候了。高性能、高生产力,超轻量级的ORM。156kb (Dapper:168kb)So SmartSqlTargetFrameworks: .NETFramework 4.6 & .NETStandard 2.0SmartSql = SmartSql = MyBatis + Cache(Memory | Redis) + ZooKeeper + R/W Splitting +Dynamic Repository + ......主要特性1 ORM1.1 Sync1.2 Async2 XmlConfig & XmlStatement -> Sql2.1 SmartSqlMapConfig & SmartSqlMap (是的,你猜对了,和MyBatis一样,通过XML配置分离SQL。)2.2 Config Hot Update ->ConfigWatcher & Reload (配置文件热更新:当你需要修改Sql的时候,直接修改SqlMap配置文件,保存即可。)3 读写分离3.1 读写分离3.2 多读库 权重筛选 (配置多读库,根据读库权重选举读库)4 日志4.1 基于 Microsoft.Extensions.Logging.Abstractions (当你需要跟踪调试的时候一切都是那么一目了然)5 Dynamic Repository5.1 SmartSql.DyRepository (解放你的双手,你来定义仓储接口,我来实现数据库访问)6 查询缓存 (热数据缓存,一个配置轻松搞定)6.1.1 Fifo6.1.2 Lru6.1 SmartSql.Cache.Memory6.2 SmartSql.Cache.Redis6.3 缓存事务一致性7 分布式配置插件7.2.1 Load SmartSqlMapSource Xml7.3.1 Load SmartSqlMapSource Directory7.1 IConfigLoader (配置文件加载器)7.2 LocalFileConfigLoader (本地文件配置加载器)7.3 SmartSql.ZooKeeperConfig (ZooKeeper 分布式配置文件加载器)性能评测BenchmarkDotNet=v0.10.14, OS=Windows 10.0.17134 Intel Core i7-6700K CPU 4.00GHz (Skylake), 1 CPU, 8 logical and 4 physical cores .NET Core SDK=2.1.201 [Host] : .NET Core 2.0.7 (CoreCLR 4.6.26328.01, CoreFX 4.6.26403.03), 64bit RyuJIT DefaultJob : .NET Core 2.0.7 (CoreCLR 4.6.26328.01, CoreFX 4.6.26403.03), 64bit RyuJIT ORMTypeMethodReturnMeanErrorStdDevRankGen 0Gen 1Gen 2AllocatedNativeNativeBenchmarksQuery_GetValue_DbNullIEnumerable`178.39 ms0.8935 ms0.7921 ms13000.00001125.0000500.000015.97 MBSmartSqlSmartSqlBenchmarksQueryIEnumerable`178.46 ms0.2402 ms0.1875 ms12312.50001000.0000312.500012.92 MBSmartSqlDapperSmartSqlDapperBenchmarksQueryIEnumerable`178.65 ms1.2094 ms1.1312 ms13687.50001437.5000687.500019.03 MBNativeNativeBenchmarksQuery_IsDBNull_GetValueIEnumerable`178.84 ms0.8984 ms0.7502 ms12312.50001000.0000312.500012.92 MBDapperDapperBenchmarksQueryIEnumerable`179.00 ms1.0949 ms0.9706 ms13312.50001312.5000625.000017.19 MBEFEFBenchmarksQueryIEnumerable`179.44 ms1.6880 ms1.5789 ms16250.0000--26.05 MBSqlSugarSqlSugarBenchmarksQueryIEnumerable`181.09 ms0.8718 ms0.7728 ms22187.5000875.0000250.000012.64 MBChloeChloeBenchmarksQueryIEnumerable`183.86 ms1.2714 ms1.1893 ms32250.0000937.5000312.500012.62 MBEFEFBenchmarksSqlQueryIEnumerable`189.11 ms0.7562 ms0.6314 ms48187.5000125.0000-33.68 MBEFEFBenchmarksQuery_NoTrackingIEnumerable`193.13 ms0.8458 ms0.7912 ms55875.00002250.00001062.500029.71 MBEFEFBenchmarksSqlQuery_NoTrackingIEnumerable`1106.89 ms1.0998 ms1.0288 ms67437.50002875.00001312.500037.34 MB示例项目SmartSql-Starter另外建议感兴趣的同学可以用 SmartCode 配置好数据库链接,生成解决方案,直接 Run 来体验 SmartSql !文档地址在线阅读地址PDFMobiePub