From 609429c12ad7863a63a3a97d523e7c203e644fea Mon Sep 17 00:00:00 2001 From: "Mirar (Pontus Hagland)" <pike@sort.mirar.org> Date: Wed, 29 Jan 2003 09:43:48 +0100 Subject: [PATCH] these didn't really append, changing so they append (gosh, that was slow) Rev: lib/modules/Tools.pmod/Shoot.pmod/AppendMapping.pike:1.2 Rev: lib/modules/Tools.pmod/Shoot.pmod/AppendMultiset.pike:1.2 --- lib/modules/Tools.pmod/Shoot.pmod/AppendMapping.pike | 9 ++++----- lib/modules/Tools.pmod/Shoot.pmod/AppendMultiset.pike | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/modules/Tools.pmod/Shoot.pmod/AppendMapping.pike b/lib/modules/Tools.pmod/Shoot.pmod/AppendMapping.pike index dda9fe5eb7..dd2d59a390 100644 --- a/lib/modules/Tools.pmod/Shoot.pmod/AppendMapping.pike +++ b/lib/modules/Tools.pmod/Shoot.pmod/AppendMapping.pike @@ -2,8 +2,8 @@ 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 k = 10; /* variable to tune the time of the test */ +int m = 1000; /* the target size of the mapping */ int n = m*k; // for reporting void perform() @@ -11,9 +11,8 @@ 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; + for (int j=0; j<m; j++) + v|=([j:42]); } } diff --git a/lib/modules/Tools.pmod/Shoot.pmod/AppendMultiset.pike b/lib/modules/Tools.pmod/Shoot.pmod/AppendMultiset.pike index c0aa838d86..57d04d78be 100644 --- a/lib/modules/Tools.pmod/Shoot.pmod/AppendMultiset.pike +++ b/lib/modules/Tools.pmod/Shoot.pmod/AppendMultiset.pike @@ -2,8 +2,8 @@ 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 k = 10; /* variable to tune the time of the test */ +int m = 1000; /* the target size of the multiset */ int n = m*k; // for reporting void perform() @@ -11,9 +11,8 @@ 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; + for (int j=0; j<m; j++) + v|=(<j>); } } -- GitLab