comments.
Copy Code code as follows:
Using System;
Using System.Diagnostics;
Using System.Data;
Using System.Data.SqlClient;
Using COM. DataAccess;
Namespace Consoleappinserttest
{
Class Program
{
static string connectionString = Sqlhelper.connectionstringlocaltransaction; Database connection string
static int count = 1000000; Number of bars inserted
static void Main (string[] args)
{
Long commoninsertruntime = Commoninsert ();
Console.WriteLine (String. Format (the ti
Program{Static string connectionstring = sqlhelper. connectionstringlocaltransaction; // database connection stringStatic int COUNT = 1000000; // Number of inserted itemsStatic void main (string [] ARGs){// Long commoninsertruntime = commoninsert ();// Console. writeline (string. Format ("the time used to insert {1} pieces of data in normal mode is {0} millisecond", commoninsertruntime, count ));Long sqlbulkcopyinsertruntime = sqlbulkcopyinsert ();Console. writeline (string. Format ("the time u
I talked with others about the performance of linq yesterday. I feel that the performance of linq is not good, but in fact it is still outstanding in terms of performance, except for the ability to write data to SQL, the following is a simple performance test comparison code. Here I will explain that the execution speed of the Code cannot be tested using datetime. I am still a little white, just starting with datetime, the results showed that the performance of the linq service was not good, but
I talked with others about the performance of LINQ yesterday. I feel that the performance of LINQ is not good, but in fact it is still outstanding in terms of performance, except for the ability to write data to SQL, the following is a simple performance test comparison code. Here I will explain that the execution speed of the Code cannot be tested using datetime. I am still a little white, just starting with datetime, the results showed that the performance of the LINQ service was not good, but
In a project, it is often necessary to log records of execution performance (time spent) of some methods, which are implemented in two ways.StopWatchUsing the Stopwatch class to measure time is very simple. Like the stopwatch in real life, this class of objects can start, stop, zero (reset) operations on the counter, but it is much more accurate than the average stopwat
It seems boring, but no one is doing it. Let me work hard.
Below are some simple tests. The Unit is ms. Note that the number of loops used here is 100, and the number of loops is.
These records can be used as a reference for programming.
Test Platform:
Pentium 1.6g dual-core CPU1 GB memoryTest the debugging environment of vs2008.
1. arraylist (100 W, 1 W)
Stopwatch Timer
=
New
Stopwatch
method for obtaining objects. This method is used with constructor, factory, and service locator (such as JNDI )) compared with traditional methods, these methods provide better reusability, testability, and maintainability. The processing process of this method is a well-known dependency injection, which is very valuable to most applications.
In our program, many types depend on other types. For example, a stopwatch may depend on a timesource. If so
already has a common hump representation, split it up by its composition (such as "AdWords" will split into "ad words"). It is important to note that "IOS" is not a real hump representation, so the recommendation does not apply to it.
Now all the letters are lowercase (including abbreviations), and then capitalize the first letter of the word:
The first letter of each word is capitalized, and comes to a large hump-type name.
In addition to the first word, the first le
.
lowercase all letters (including abbreviations) and capitalize the first letter of a word:
Capitalize the first letter of each word to get a big hump-named (uppercamelcase)
In addition to the first word, the first letter of each word is capitalized to get the small hump-type name (Lowercamelcase)
Finally, link all the words together to get a representation.
Example
Prose Form
Correct
Incorrect
"XML HTTP Request"
XmlHttpRequest
hump-type name.4. Finally connect all the words together to get an identifier.Example:Prose Form Correct Incorrect------------------------------------------------------------------"XML HTTP Request" XMLHttpRequest XMLHttpRequest"New Customer ID" Newcustomerid Newcustomerid"Inner stopwatch" Innerstopwatch Innerstopwatch"Supports IPV6 on IOS?" Supportsipv6onios Supportsipv6onios"YouTube Importer" Youtubeimpo
Correct Incorrect------------------------------------------------------------------"XML HTTP Request" XMLHttpRequest XMLHttpRequest"New Customer ID" Newcustomerid Newcustomerid"Inner stopwatch" Innerstopwatch Innerstopwatch"Supports IPV6 on IOS?" Supportsipv6onios Supportsipv6onios"YouTube Importer" Youtubeimporteryoutubeimporter*Asterisking indicates yes, but not recommended.Note: in English, some word fo
This series of articles collects 100 sets of freshly released exquisite free articles for you to download and use for free. These high-quality websitesPSDMaterials help you work with ease and save a lot of time and energy. Thanks to the outstanding designers for sharing their labor achievements so that more people can use their creative designs.PSDMaterials can help you. Recommended reading: Series 1 and Series 2.
Blaubarry UI Kit
CD Cover Art and Player
Eye Candy Percentage Bar PSD Freebie
In this case, the time for issuing the ticket will be 10 minutes-> 20 seconds. This is amazing.
Now, let's go to the demo, test, and change it to a method test that we generally use. nnd is really fast.
Paste my demo: sqlbulkcopy.rar here
CopyCode The Code is as follows:
Using system;
Using system. diagnostics;
Using system. Data;
Using system. Data. sqlclient;
Using Microsoft. applicationblocks. Data;
Namespace consoleappinserttest
{
Class Program
{
Static int COUNT = 1000000; // Number of in
Many times it takes time for the output program to be recorded,always start recording the current point of time at the beginning of the program execution, at the end of the record end point in time, and then subtract two times,so is there any other way to be a little bit more presentable? Tell you, there is a drop; )the subject of this method is StopwatchHis description is: For accurate measurement of the running time, you need to record time-consuming students who applause?Specific use:System.D
insert {1} pieces of data using SqlBulkCopy is {0} millisecond", sqlBulkCopyInsertRunTime, count ));
Long commonInsertRunTime = CommonInsert ();
Console. WriteLine (string. Format ("the time taken to insert {1} pieces of data in normal mode is {0} millisecond", commonInsertRunTime, count ));
Console. ReadKey ();
}
///
/// Insert data normally///
///
Private static long CommonInsert ()
{
Stopwatch stopwatch
In this way, our Fashui ticket time will be 10 minutes-->20 seconds, which is amazing.
As a then, the next demo, testing, change to their own general methods of testing, NND, can really say is the speed.
Put my Demo:SqlBulkCopy.rar in here.
Copy Code code as follows:
Using System;
Using System.Diagnostics;
Using System.Data;
Using System.Data.SqlClient;
Using Microsoft.ApplicationBlocks.Data;
Namespace Consoleappinserttest
{
Class Program
{
static int count = 1000000; Numbe
In this case, the time for issuing the ticket will be 10 minutes-> 20 seconds. This is amazing.
Now, let's go to the demo, test, and change it to a method test that we generally use. nnd is really fast.
Paste my demo: sqlbulkcopy.rar here
CopyCode The Code is as follows: using system;
Using system. diagnostics;
Using system. Data;
Using system. Data. sqlclient;
Using Microsoft. applicationblocks. Data;
Namespace consoleappinserttest
{
Class Program
{
Static int COUNT = 1000000; // Number of ins
In this way, our Fashui ticket time will be 10 minutes-->20 seconds, which is amazing.
As a then, the next demo, testing, change to their own general methods of testing, NND, can really say is the speed.
Put my Demo:SqlBulkCopy.rar in here.
Copy CodeThe code is as follows:
Using System;
Using System.Diagnostics;
Using System.Data;
Using System.Data.SqlClient;
Using Microsoft.ApplicationBlocks.Data;
Namespace Consoleappinserttest
{
Class Program
{
static int count = 1000000; Number of bars inser
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.