Forum: VoltDB Architecture

Post: Why is csvloader faster then C# application?

Why is csvloader faster then C# application?
Nikpraskaton
Jan 16, 2013
Hi,
so i wanted to test the fastness of VoltDB insert procedure and i'v create some small application in C#:

try
{
using (var conn = VoltConnection.Create("hosts=192.168.2.100").Open())
{
for (int i = 1; i <= 100000; i++)
{
var insert = conn.Procedures.Wrap<Table[], int, string, string>("procProbaInsert");
insert.Execute(i, "Ime" + i, "OpisProizvoda + " + i);
}

}
}
catch (Exception x)
{
throw new Exception("Neka gre&#353;ka:" + x.Message);
}

When I run this app. program is running for almost cca. 10 min.
But, when I started this code:


StreamWriter st = new StreamWriter("c:\\test.txt");

for (int i = 0; i <= 100000; i++)
{
st.WriteLine(i + "," + "Ime" + i + "," + "Opis" + i + "");
}

st.Close();

and app. wrote all of 100 000 rows in .txt file and I invoked csvloader to insert all that rows it last cca. 10 sec.

Why??

Thanks
MichaelGG
Feb 23, 2013
Because you are calling Execute synchronously. You must use async to get proper performance. Read some of the docs like here, which explain how it works:
http://blog.voltdb.com/blog-voltdb-net/