diff --git a/lib/modules/Tools.pmod/Shoot.pmod/AppendArray.pike b/lib/modules/Tools.pmod/Shoot.pmod/AppendArray.pike new file mode 100644 index 0000000000000000000000000000000000000000..b4519361f35129024c027b1e195f4fcbcc921d04 --- /dev/null +++ b/lib/modules/Tools.pmod/Shoot.pmod/AppendArray.pike @@ -0,0 +1,22 @@ +inherit Tools.Shoot.Test; + +constant name="Append array"; + +int k = 5; /* variable to tune the time of the test */ +int m = 100000; /* the target size of the array */ +int n = m*k; // for reporting + +void perform() +{ + for (int i=0; i<k; i++) + { + array v=({}); + for (int j=0; j<m; j++) + v+=({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/AppendMapping.pike b/lib/modules/Tools.pmod/Shoot.pmod/AppendMapping.pike new file mode 100644 index 0000000000000000000000000000000000000000..dda9fe5eb7b6fea6090cef9bc799a9c0c65fcd93 --- /dev/null +++ b/lib/modules/Tools.pmod/Shoot.pmod/AppendMapping.pike @@ -0,0 +1,23 @@ +inherit Tools.Shoot.Test; + +constant name="Append 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=([]); + int z=i*m+m; + for (int j=i*m; j<z; 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/AppendMultiset.pike b/lib/modules/Tools.pmod/Shoot.pmod/AppendMultiset.pike new file mode 100644 index 0000000000000000000000000000000000000000..c0aa838d865f4aee63ac75df256246672710ce29 --- /dev/null +++ b/lib/modules/Tools.pmod/Shoot.pmod/AppendMultiset.pike @@ -0,0 +1,23 @@ +inherit Tools.Shoot.Test; + +constant name="Append 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=(<>); + int z=i*m+m; + for (int j=i*m; j<z; j++) + v[j]=42; + } +} + +string present_n(int ntot,int nruns,float tseconds,float useconds,int memusage) +{ + return sprintf("%.0f/s",ntot/useconds); +}