Skip to content
Snippets Groups Projects
Commit f9b5b35a authored by Mirar (Pontus Hagland)'s avatar Mirar (Pontus Hagland)
Browse files

And these tests insertation in mappings and multisets

Rev: lib/modules/Tools.pmod/Shoot.pmod/InsertMapping.pike:1.1
Rev: lib/modules/Tools.pmod/Shoot.pmod/InsertMultiset.pike:1.1
parent 609429c1
Branches
Tags
No related merge requests found
inherit Tools.Shoot.Test;
constant name="Insert in mapping";
int k = 5; /* variable to tune the time of the test */
int m = 100000; /* the target size of the mapping */
int n = m*k; // for reporting
void perform()
{
for (int i=0; i<k; i++)
{
mapping v=([]);
for (int j=0; j<m; j++)
v[j]=42;
}
}
string present_n(int ntot,int nruns,float tseconds,float useconds,int memusage)
{
return sprintf("%.0f/s",ntot/useconds);
}
inherit Tools.Shoot.Test;
constant name="Insert in multiset";
int k = 5; /* variable to tune the time of the test */
int m = 100000; /* the target size of the multiset */
int n = m*k; // for reporting
void perform()
{
for (int i=0; i<k; i++)
{
multiset v=(<>);
for (int j=0; j<m; j++)
v[j]=42;
}
}
string present_n(int ntot,int nruns,float tseconds,float useconds,int memusage)
{
return sprintf("%.0f/s",ntot/useconds);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment