I was benchmarking the Composite DataConnection class, so consider the following code :
The slowest part of this script is the creation of the empty user.
Saving the list takes less than a second but generating the list takes more than 1 min 30 seconds.
Do anyone of you know why ? Is there a more effeciant way of doing that ?
Thanks.
var userList = new List<RegisteredUsers>();
using (DataConnection connection = new DataConnection())
{
for (int i = 0; i < (100000); i++)
{
var user = DataConnection.New<RegisteredUsers>();
user.Id = Guid.NewGuid();
user.Name = "John";
user.LastName = "Doe";
user.Email = "john.doe@ay.com";
user.Password = "rawr";
userList.Add(user);
}
connection.Add<RegisteredUsers>(userList);
}
I create a list of 100,000 elements via C# using the DataConnection.New<T>()
method and save it using the connection.AddThe slowest part of this script is the creation of the empty user.
Saving the list takes less than a second but generating the list takes more than 1 min 30 seconds.
Do anyone of you know why ? Is there a more effeciant way of doing that ?
Thanks.