Moon. ORM-4.4 was released to showcase its performance and ease of use (mysoft, cyq, pdf)

Source: Internet
Author: User

In terms of performance, there is no framework comparable to moon (non-pure ADO.. NET), in addition to the Entity Framework, you can use the frameworks. however, I like the idea of PDF, which can be implemented without reflection, so the performance is very high. here, it indicates that there is no intention of war, just the Moon team that told me. orm supporters and friends who do not understand ORM can see the performance.

Performance

4.4 restructured the automatic compilation method.

For example:

List <North. Orders> list = DBFactory. GetEntitiesH <North. Orders> (OrdersTable. OrderID. BiggerThan (0), "assembly where the entity is located ");

Check the code.

/*** To change this template, Click Tools | options | code writing | edit standard header file */using System; using CYQ. data; using CYQ. data. table; using CYQ. entity; using CYQ. entity. myNorthWind; using MDB; using Moon. orm; using MySoft. data; using North; using PWMIS. dataMap. entity; namespace Demo {class Program {public static void Main (string [] args) {// --------- there may be preprocessing, regardless of ---------------- PDF. northWind. customers pdft = new PDF. northWind. customers (); OQL qt = new OQL (pdft); qt. select (). where (qt. condition. AND (pdft. customerID, ">", 1); var resultt = EntityQuery <PDF. northWind. customers>. queryList (qt); // PWMIS. dataProvider. data. adoHelper db = PWMIS. dataProvider. adapter. myDB. getDBHelperByConnectionName ("pdf"); using (MAction actiont = new MAction (TableNames. customers) {if (actiont. fill ("CustomerID> 1") // query the single row data with the largest ID in the result of ID> 888 {var listt = actiont. select (). toList <North. customers> () ;}} DbSession dbSession = new DbSession (new MySoft. data. sqlServer9.SqlServer9Provider (System. configuration. configurationSettings. appSettings ["linkString"]); // dbSession. cacheOff (); // The first dynamic compilation var test = DBFactory. getEntitiesH <North. customers> (CustomersTable. customerID. biggerThan (0), "demo.exe"); var listMysoft = dbSession. from <MySoft. customers> (). where (MySoft. MERs. _. customerID> 0 ). toList <MySoft. customers> (); // ================================================ long t1 = DateTime. now. ticks; for (int I = 0; I <800; I ++) {PDF. northWind. MERs pdf = new PDF. northWind. customers (); OQL q = new OQL (pdf); q. select (). where (q. condition. AND (pdf. customerID, ">", 1); var result = EntityQuery <PDF. northWind. customers>. queryList (q);} long t2 = DateTime. now. ticks; Console. writeLine ("PDF. NET: "+ (t2-t1); long a1 = DateTime. now. ticks; for (int I = 0; I <800; I ++) {// note that we also get an Entity Data from> 0 var test2 = DBFactory. getEntitiesH <North. customers> (CustomersTable. customerID. biggerThan (0), "demo.exe");} var a2 = DateTime. now. ticks; Console. writeLine ("Moon. orm: "+ (a2-a1); long c1 = DateTime. now. ticks; for (int I = 0; I <800; I ++) {using (MAction action = new MAction (TableNames. customers) {if (action. fill ("CustomerID> 1") // query the single row data with the largest ID in the result with ID> 888 {var list = action. select (). toList <North. customers> () ;}} var c2 = DateTime. now. ticks; Console. writeLine ("CYQ. DATA: "+ (c2-c1); var m1 = DateTime. now. ticks; for (int I = 0; I <800; I ++) {var list2 = dbSession. from <MySoft. customers> (). where (MySoft. MERs. _. customerID> 0 ). toList <MySoft. customers> ();} var m2 = DateTime. now. ticks; Console. writeLine ("MySoft:" + (m2-m1); Console. write ("Press any key to continue... "); Console. readKey (true );}}}

Running result:

Part 2 Development and ease of use

Step 1: Open the Enterprise Edition Code Generator

 

 

Step 2: Enter the project database

Step 3: generate an object set or object-class file

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.