Moon.Orm性能報告

以下為有網友公司的評估測試及使用規范

大家可以下載word看看

http://pan.baidu.com/s/1hquvRuc

一、和ADO.NET進行的壓力測試

說明:2000并發用戶,此圖為一網友公司對moon.orm的測評

二、和ADO.NET的性能對比測試

說明:同時請求10000條數據,此圖為一網友公司對moon.orm的測評

三、和實體框架的對比測試

using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Moon.Orm;
using EfTest.Models;
using eftest;
namespace EfTest
{class Program{private static readonly Stopwatch Watch = new Stopwatch();static void Main(string[] args){Watch.Start();Database.SetInitializer(new SampleData());using (var db = new TestContext()){db.Database.Initialize(false);}Watch.Stop();//Console.WriteLine("數據庫初始化完成,耗時{0}", Watch.Elapsed);Method01();StartTest();}private static void Method01(){Console.WriteLine("查詢預熱,防止第一次查詢影響結果。");var db = new TestContext();Console.WriteLine("產品目錄個數:{0}", db.Categories.Count());Console.WriteLine("客戶個數:{0}", db.Customers.Count());Console.WriteLine("產品個數:{0}", db.Products.Count());Console.WriteLine("訂單個數:{0}", db.Orders.Count());Console.WriteLine("訂單明細個數:{0}", db.OrderDetails.Count());db.Dispose();Console.WriteLine("查詢預熱結束-------------------------\r\n");}private static void StartTest(){Console.WriteLine("單表查詢");EFTest1();MoonTest1();MoonDyanimic();Console.WriteLine();Console.WriteLine("連接查詢");EFTestJoin();MoonTestJoin();Console.WriteLine();Console.WriteLine("嵌套查詢");EFTestQianTao();MoonTestQianTao();Console.Read();}private static void EFTest1(){Watch.Restart();var db = new TestContext();db.Configuration.AutoDetectChangesEnabled=false;var list = db.OrderDetails.Where(m=>m.DetailId>1&&m.UnitPrice>0).ToList();db.Dispose();Watch.Stop();Console.WriteLine("  EFTest1:"+Watch.Elapsed);}private static void MoonTest1(){Watch.Restart();using (Db db=Db.CreateDefaultDb()) {var mql2=OrderDetailsSet.SelectAll().Where(OrderDetailsSet.UnitPrice.BiggerThan(0).And(OrderDetailsSet.DetailId.BiggerThan(1)));var list2=db.GetEntities<OrderDetails>(mql2);}Watch.Stop();Console.WriteLine("MoonTest1:"+Watch.Elapsed);}private static void MoonDyanimic(){using (Db db=Db.CreateDefaultDb()) {var list2=db.GetDynamicList("select * from OrderDetails where DetailId>10 ","hi");}Watch.Restart();using (Db db=Db.CreateDefaultDb()) {var mql=OrderDetailsSet.SelectAll();var list2=db.GetDynamicList("select * from OrderDetails where DetailId>1 and UnitPrice>0 ","hi");}Watch.Stop();Console.WriteLine("MoonDyanimic:"+Watch.Elapsed);}private static void EFTestJoin(){Watch.Restart();var db = new TestContext();db.Configuration.AutoDetectChangesEnabled=false;var list = db.OrderDetails.Where(m=>m.DetailId>3&&m.UnitPrice>0).Select(m => new{m.DetailId,m.UnitPrice,m.Product.ProductName}).ToList();foreach (var A in list) {Console.WriteLine(A.DetailId+"  "+A.UnitPrice+" "+A.ProductName);break;}db.Dispose();Watch.Stop();Console.WriteLine("  EFTestJoin:"+Watch.Elapsed);}private static void MoonTestJoin(){Watch.Restart();using (Db db=Db.CreateDefaultDb()) {var mql2=OrderDetailsSet.Select(OrderDetailsSet.DetailId,OrderDetailsSet.UnitPrice);var mql=ProductsSet.Select(ProductsSet.ProductName);var join=mql.LeftJoin(mql2).ON(OrderDetailsSet.ProductId.Equal(ProductsSet.ProductId)).Where(OrderDetailsSet.UnitPrice.BiggerThan(0).And(OrderDetailsSet.DetailId.BiggerThan(3)));var list2=db.GetDictionaryList(join);foreach (var A in list2) {Console.WriteLine(A["DetailId"]+"  "+A["UnitPrice"]+" "+A["ProductName"]);break;}}Watch.Stop();Console.WriteLine("MoonTestJoin:"+Watch.Elapsed);}private static void MoonTestQianTao(){Watch.Restart();using (Db db=Db.CreateDefaultDb()) {var mql=ProductsSet.SelectAll().Where(ProductsSet.CategoryId.In(CategoriesSet.Select(CategoriesSet.CategoryId).Where(CategoriesSet.CategoryName.Equal("分類00"))));var sql=mql.ToDebugSQL();var list=db.GetEntities<Products>(mql);}Watch.Stop();Console.WriteLine("MoonTestQianTao:"+Watch.Elapsed);}private static void EFTestQianTao(){Watch.Restart();var db = new TestContext();db.Configuration.AutoDetectChangesEnabled=false;var list = db.Products.Where(m=>m.Category.CategoryName.Equals("分類00")).ToList();db.Dispose();Watch.Stop();Console.WriteLine("  EFTestQianTao:"+Watch.Elapsed);}}
}

執行文件下載地址
http://pan.baidu.com/s/1i3khc0H
先在sqlserver數據庫中建一個名為:TestContext
的數據庫,
您只需修改配置文件中的連接字符串
然后運行即可

?以下為網友運行截圖

?

?

轉載于:https://www.cnblogs.com/humble/p/3472764.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/377436.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/377436.shtml
英文地址,請注明出處:http://en.pswp.cn/news/377436.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Spring中MultipartHttpServletRequest實現文件上傳

轉貼自&#xff1a;http://zhupan.iteye.com/blog/26427 實現圖片上傳   用戶必須能夠上傳圖片&#xff0c;因此需要文件上傳的功能。比較常見的文件上傳組件有Commons FileUpload&#xff08;http://jakarta.apache.org/commons/fileupload/a>&#xff09;和COS FileUplo…

(保守群組測試 非保守群組測試 二次重復測試 自適應二次重復測試)四種群體測試的C++代碼

目錄原理保守組檢測非保守組檢測二次重復測試自適應二次重復測試四種測試方法的核心代碼保守群組測試非保守群組測試二次重復測試與自適應二次重復測試測試代碼參考文獻原理 假設該病在人群中的患病率&#xff08;先驗概率&#xff09;為p&#xff0c;我們想用群體檢驗法檢驗N…

AngularJS中的表達式

AngularJS表達式 (AngularJS Expressions) In AngularJS, expressions are solved to give a result. It outputs the result of the expression in the html element that called it. Expressions in AngularJS contain literals, constants, operators and variables with re…

學習總結:機器學習(一)

有監督學習&#xff08;Supervised Learning&#xff09;所謂有監督學習&#xff0c;是區別于無監督學習而言的。其過程如下&#xff1a;給定一系列樣本&#xff0c;樣本是由一系列特征值和輸出值組成。比如&#xff0c;某個地方的商品房&#xff0c;包括房子大小、房間數、距離…

Silverlight讀取與設置Cookies

Silverlight讀取與設置Cookies 設置Cookie DateTime expire DateTime.UtcNow TimeSpan.FromDays(30);string cookie string.Formate("{0}{1},expires{2}",key,value,expire)HtmlPage.SetProperty("cookie",cookie);讀取Cookie 由于讀取到的Cookie是一個…

WPS雙欄格式下插入單欄圖片

以一個我認識的西工大博士大佬的一篇SCI為例&#xff0c;期刊是雙欄&#xff0c;圖片過大&#xff0c;需要單欄進行展示&#xff0c;效果圖如下&#xff1a; 一、雙欄內容 二、插入單欄圖像 隨便敲幾個字&#xff0c;選中&#xff0c; 頁面布局----分欄---一欄 這行字就會…

JavaScript中的數組

Here we are discussing one of the most useful data structure, Array. 在這里&#xff0c;我們討論最有用的數據結構之一Array 。 By conventional definition of arrays, "Arrays are the homogeneous collection of data types. But in JS, Arrays simply are the c…

【C++基礎】異常處理機制概要

目錄C的異常處理方法知識要點踹扔抓的代碼塊示例兩種處理被0除的方法異常處理機制的優點其他語言中的異常處理C函數異常聲明C的異常處理方法知識要點 理解“踹扔抓”三部曲的結構&#xff0c;尤其是catch是怎么匹配異常的。 知道C標準庫中的異常類都是從exception繼承下來的&am…

[轉載]Struts2 獲得Session和Request

轉自http://www.blogjava.net/lyyb2001/archive/2008/03/07/184593.html 在struts1中&#xff0c;獲得到系統的request或者session對象非常方便&#xff0c;都是按照形參傳遞的&#xff0c;但是在struts2中&#xff0c;request和session都被隱藏了struts提供兩種方式訪問sessio…

WPS根據章節編號依次排序

第Ⅲ章節有四小部分&#xff0c;分別為A、B、C、D 第Ⅳ章節要重新開始編號&#xff0c;從A開始 操作步驟&#xff1a; ①再D后面回車&#xff08;紅線位置回車&#xff09;&#xff0c;生成E ②把Ⅳ中待寫內容寫到E中 ③將E復制到Ⅳ下&#xff0c;這里需要注意D的換行也要復制…

【C++基礎】異常匹配與內建異常類

目錄異常匹配catch: 按異常類型匹配為何要使用異常類內建異常類標準庫中的異常基類標準庫中的異常類例1&#xff1a;vector下標訪問越界out_of_range異常例2&#xff1a;內存分配失敗bad_alloc異常例3&#xff1a;側向轉換失敗bad_cast異常類幾種情況&#xff0c;使用對應異常異…

scala 訪問修飾符_Scala中的訪問修飾符

scala 訪問修飾符Access modifiers are used in order to restrict the usage of a member function to a class or a package. Using access modifiers data hiding takes place which is a very important concept of OOPs. 訪問修飾符用于將成員函數的使用限制為類或包。 使…

小試---EF5.0入門實例1

現在做個小練習吧~~~ 第一步&#xff1a;首先新建一個數據庫名字為Test;數據庫里面只有一個表UserTable 腳本為&#xff1a; USE [master] GO /****** 對象: Database [Test] 腳本日期: 12/15/2013 18:51:54 ******/ CREATE DATABASE [Test] ON PRIMARY ( NAME NTest, F…

iScroll4 禁止select等頁面元素默認事件的解決方法 轉

iScroll4 禁止select等頁面元素默認事件的解決方法起因在于onBeforeScrollStart : function(e){ e.preventDefault(); },這一行&#xff0c;iSroll禁止了事件的默認行為&#xff0c;導致select&#xff0c;option&#xff0c;textarea等元素無法點擊。解決方法也很簡單&#xf…

C++中比較兩個浮點數是否相等

來源&#xff1a; https://stackoverflow.com/a/37686/3242645 代碼&#xff1a; #include <cmath> #include <limits> bool AreSame(double a, double b) {return std::fabs(a - b) < std::numeric_limits<double>::epsilon(); }

MPEG的完整形式是什么?

MPEG&#xff1a;運動圖像專家組 (MPEG: Moving Picture Experts Group) MPEG is an abbreviation of Moving Picture Experts Group. It is a working group of authorities that is founded to establish standards for audio and video compression and transmission. The a…

正則 去除html標記

//string regexstr "<[^>]*>"; //去除所有的標簽 //"<script[^>]*?>.*?</script>" //去除所有腳本&#xff0c;中間部分也刪除 // string regexstr "<img[^>]*>"; //去除圖片的正則 // string regexstr &…

自畫PopMenu彈出

BorderColor:TColor; //邊框顏色FillColor:TColor; //未選中填充顏色TextColor:TColor; //未選中字體顏色SelectTextColor:TColor; //選中字體顏色SelectFillColor:TColor; //選中填充顏色SideBuffer:Integer; //邊框寬度procedure TForm1.FormCreate(Sender: TObject); b…

安利一款倒計時插件---雨滴桌面

內容來自B站(搜索Rainmeter即可)&#xff0c;里面教程很多&#xff0c;因為視頻看的有點麻煩&#xff0c;故進行了整理 一、下載安裝包、解壓、安裝 免費下載連接&#xff0c;不需要積分 skin文件夾存放皮膚的一些配置文件&#xff0c;因為原本皮膚太low了 第二個是可執行文…

【C++基礎】自定義異常類與多重捕獲

目錄自定義異常類構建過程例&#xff1a;Vec3D類的數組下標越界的異常類捕獲多種無關異常不同的異常的捕獲捕獲派生異常異常處理的次序例子&#xff1a;多重捕獲異常類catch塊的參數類型可以不用引用類型嗎?自定義異常類 自定義異常類通常由exception或其后代類派生。這樣我們…