1. sanping peng
  2. .NET DataStore
  3. Saturday, 22 January 2022 10:31 AM UTC

Hi Appeon,

    Is there any .net datastore performance test to help developer to make decision to invest appeon's .net datastore tech stack?

    Tell us why .net datastore  is better than  ms efcore、dapper or other ormapping framework.

    Thanks.

Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Saturday, 22 January 2022 17:00 PM UTC
  2. .NET DataStore
  3. # 1

Hi Sanping,

EF Core and Dapper are very different ORMs.  With Dapper you are coding SQL whereas in EF Core you are not.  

.NET DataStore is similar to EF Core and driven by C# models.  Even though there are similarities, Appeon invested to create .NET DataStore to address some shortcomings of EF Core:

1. EF Core is very complex framework.  Many developers don't really understand how to properly use it.  This is why you see some developers complain about performance problems while others say it is great.

2. EF Core is not low-code development.  You can compare the sample code in the showcase, and for more complex development there is even bigger difference.  Basically, programming business logic with .NET DataStore is similar productivity as DataWindow in native PB.

3. EF Core has huge learning curve for PowerBuilder developers.  Whereas .NET DataStore has virtually all the same properties, events, and functions as the DataWindow in native PB.

Performance wise EF Core is very good (if you know what you are doing), but I want to caution you because it is complex framework I think for many customers the .NET DataStore will perform better in real-life situation.  By the way, the .NET DataStore showcase has some performance benchmarks.

Best regards,
Armeen

Comment
There are no comments made yet.
sanping peng Accepted Answer Pending Moderation
  1. Saturday, 22 January 2022 20:16 PM UTC
  2. .NET DataStore
  3. # 2

Hi,Armeen,

    thanks for your reply.

    I have visited the site you provided,the performance is very good!

 but my test code as below(referenced the .net datastore sample code from github):

Console.WriteLine("Please input enter!");
Console.ReadKey();
{
Stopwatch st = new Stopwatch();
st.Start();
for (int i = 0; i < 1000; i++)
{
DataStore<appfunc> ds = new DataStore<appfunc>();
//lst.Add(ds);
}
st.Stop();
Console.WriteLine("new datastore:" + st.Elapsed.TotalMilliseconds);
}

appfunc is a POCO Model class has six compute columns and about 10 common columns

//-----------------------------------------
//computes
[DwCompute(@"disabled+1+flagdelete+1+sortid+1")]
public int? total { get; set; }
[DwCompute(@"disabled+1+flagdelete+1+sortid+1")]
public int? total1 { get; set; }
[DwCompute(@"disabled+1+flagdelete+1+sortid+1")]
public int? total2 { get; set; }
[DwCompute(@"disabled+1+flagdelete+1+sortid+1")]
public int? total3 { get; set; }
[DwCompute(@"disabled+1+flagdelete+1+sortid+1")]
public int? total4 { get; set; }
[DwCompute(@"disabled+1+flagdelete+1+sortid+1")]
public int? total5 { get; set; }

1000 times new cost about 10 seconds

but only once create datastore instance,cost about  357 ms

the performance seems not so good.

after remove compute columns,once create datastore instance,cost about  159 ms

Why?

Is there any best practice sample code for developer?

thanks!

Best regards,
Sanping

 

 

Comment
  1. sanping peng
  2. Saturday, 22 January 2022 21:18 PM UTC
bug reported,thanks!
  1. Helpful 1
  1. Miguel Leeuwe
  2. Saturday, 22 January 2022 23:04 PM UTC
Would the .Net datastore benefit from this pb.ini setting?

[Datastore Behavior]

UseHwnd=No

... or is that only for Classis powerbuilder?

regards
  1. Helpful
  1. Chris Pollach @Appeon
  2. Sunday, 23 January 2022 00:13 AM UTC
Hi Miguel ... No, that PB.inu setting is only used by the PB runtime (PBVM).
  1. Helpful 1
There are no comments made yet.
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Monday, 24 January 2022 11:34 AM UTC
  2. .NET DataStore
  3. # 3

Hi Sanping,

The first time any .NET code executes it must first be JIT compiled. The more complex the code the higher the JIT cost, usually showing as CPU and time costs. Please don't use the cost of the first execution to evaluate any .NET runtime.

Just take a List<int> for example. I create it and add some values to it. After calling 5 times, we can also see the cost of the first time is much higher than other times.

    class Program
    {
        static void Main(string[] args)
        {
            // Run 5 times
            for (int i = 0; i < 5; i++)
            {
                TestList();
            }
            
            Console.ReadKey();
        }
        
        private static void TestList() 
        {
            Stopwatch st = new Stopwatch();
            st.Start();

            var list = new List<int>();
            for (int i = 0; i < 100; i++)
            {
                list.Add(i);
            }
            
            st.Stop();
            
            Console.WriteLine("TotalMilliseconds:" + st.Elapsed.TotalMilliseconds);
        }
    }

 

It will cost more if you are creating a DataStore using Compute the first time because of the complex code for processing the string PB DataWindow expressions. But it will cost much lesser since the second time for any DataStore. This is my testing result based on your code:

Test Call the constructor method of the DataStore corresponding to the following model one after another.
Call DataStore with Compute first. 
No. Model Name Column (Count) Compute (Count) Cost (ms) Remark
1 D_Dept10Columns_Has6Compute    10 6 327.6201 It takes more time for the first time.
2 D_Dept1Column                 1 0 4.9595 It takes lesser time for calling the remaining constructors
3 D_Dept4Columns                 4 0 7.8497  
4 D_Dept8Columns                 8 0 14.725  
5 D_Dept10Columns                10 0 5.0629  
6 D_Dept10Columns_Hascompute     10 1 10.609  
7 D_Dept10Columns_Has3Compute    10 3 8.472  
8 D_Dept10Columns_Has6Compute    10 6 6.194  
9 D_Dept1Column                 1 0 7.3677  
10 D_Dept4Columns                 4 0 2.3554  
11 D_Dept8Columns                 8 0 2.2928  
12 D_Dept10Columns                10 0 7.5245  
13 D_Dept10Columns_Hascompute     10 1 3.1203  
14 D_Dept10Columns_Has3Compute    10 3 4.2983  

Regards, Logan

 

Comment
  1. sanping peng
  2. Monday, 24 January 2022 16:22 PM UTC
Hi,Logan,thanks for your reply.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.