diff --git a/lib/modules/Tools.pmod/Shoot.pmod/InsertMapping.pike b/lib/modules/Tools.pmod/Shoot.pmod/InsertMapping.pike new file mode 100644 index 0000000000000000000000000000000000000000..b172429c3ba0a55de3fb39542c6842bf6d90fb22 --- /dev/null +++ b/lib/modules/Tools.pmod/Shoot.pmod/InsertMapping.pike @@ -0,0 +1,22 @@ +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); +} diff --git a/lib/modules/Tools.pmod/Shoot.pmod/InsertMultiset.pike b/lib/modules/Tools.pmod/Shoot.pmod/InsertMultiset.pike new file mode 100644 index 0000000000000000000000000000000000000000..b9d4fbb2956d5fc5d2ee1962a671ca9436c25fef --- /dev/null +++ b/lib/modules/Tools.pmod/Shoot.pmod/InsertMultiset.pike @@ -0,0 +1,22 @@ +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); +}