The country is now catching piracy, but the. NET platform is really expensive, but it is not like giving up. net, you can only change. netframework to mono, change SQL Server to PostgreSQL, just started learning
Comparison of efficiency of connecting npgsql to PostgreSQL with ado.net Code Simple:
Double Firstms = 0.0 , Secondms = 0.0 ;
For ( Int I = 0 ; I < 1000 ; I ++ )
{
Npgsql. npgsqlconnection Conn = New Npgsqlconnection (connstr );
Conn. open ();
Conn. Close ();
}
Datetime endtime = Datetime. now;
Firstms = Endtime. Subtract (begintime). totalmilliseconds;
Datetime begintime1 = Datetime. now;
For ( Int I = 0 ; I < 1000 ; I ++ )
{
Sqlconnection sqlconn = New Sqlconnection (sqlconnstr );
Sqlconn. open ();
Sqlconn. Close ();
}
Datetime endtime1 = Datetime. now;
Secondms = Endtime1.subtract (begintime1). totalmilliseconds;
Response. Write ( String . Format ( " PostgreSQL: {0}, MSSQL: {1} " , Firstms, secondms ));
the code is simple, but the test results are not satisfactory:
PostgreSQL: 531.25, MSSQL: 15.625
PostgreSQL: 515.625, MSSQL: 15.625
PostgreSQL: 531.25, MSSQL: 15.625
PostgreSQL: 515.625, MSSQL: 0
PostgreSQL: 531.25, MSSQL: 0
it seems that free items are not easy to use