Re: [Piglit] [PATCH] framework/profile: don't deepcopy when copying profiles
Tested-by: Mark Janes Reviewed-by: Mark Janes Dylan Baker writes: > This reduces memory consumption by a lot (about 60% on my system), which > fixes some tests that fail sporadically on low memory systems. > > cc: Mark Janes > Signed-off-by: Dylan Baker > --- > framework/profile.py | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/framework/profile.py b/framework/profile.py > index 23abc6d..56f017b 100644 > --- a/framework/profile.py > +++ b/framework/profile.py > @@ -297,12 +297,11 @@ class TestProfile(object): > """Create a copy of the TestProfile. > > This method creates a copy with references to the original instance > -(using copy.copy), except for the test_list attribute, which is > copied > -using copy.deepcopy. This allows profiles to be "subclassed" by other > -profiles, without modifying the original. > +using copy.copy.deepcopy. This allows profiles to be "subclassed" by > +other profiles, without modifying the original. > """ > new = copy.copy(self) > -new.test_list = copy.deepcopy(self.test_list) > +new.test_list = copy.copy(self.test_list) > new.forced_test_list = copy.copy(self.forced_test_list) > new.filters = copy.copy(self.filters) > return new > -- > 2.10.2 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] framework/profile: don't deepcopy when copying profiles
Quoting Dylan Baker (2016-11-15 13:08:59) > This reduces memory consumption by a lot (about 60% on my system), which > fixes some tests that fail sporadically on low memory systems. > > cc: Mark Janes > Signed-off-by: Dylan Baker > --- > framework/profile.py | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/framework/profile.py b/framework/profile.py > index 23abc6d..56f017b 100644 > --- a/framework/profile.py > +++ b/framework/profile.py > @@ -297,12 +297,11 @@ class TestProfile(object): > """Create a copy of the TestProfile. > > This method creates a copy with references to the original instance > -(using copy.copy), except for the test_list attribute, which is > copied > -using copy.deepcopy. This allows profiles to be "subclassed" by other > -profiles, without modifying the original. > +using copy.copy.deepcopy. This allows profiles to be "subclassed" by oops, the ".deepcopy" is a typo. I've fixed that locally. > +other profiles, without modifying the original. > """ > new = copy.copy(self) > -new.test_list = copy.deepcopy(self.test_list) > +new.test_list = copy.copy(self.test_list) > new.forced_test_list = copy.copy(self.forced_test_list) > new.filters = copy.copy(self.filters) > return new > -- > 2.10.2 > signature.asc Description: signature ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] framework/profile: don't deepcopy when copying profiles
This reduces memory consumption by a lot (about 60% on my system), which fixes some tests that fail sporadically on low memory systems. cc: Mark Janes Signed-off-by: Dylan Baker --- framework/profile.py | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/framework/profile.py b/framework/profile.py index 23abc6d..56f017b 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -297,12 +297,11 @@ class TestProfile(object): """Create a copy of the TestProfile. This method creates a copy with references to the original instance -(using copy.copy), except for the test_list attribute, which is copied -using copy.deepcopy. This allows profiles to be "subclassed" by other -profiles, without modifying the original. +using copy.copy.deepcopy. This allows profiles to be "subclassed" by +other profiles, without modifying the original. """ new = copy.copy(self) -new.test_list = copy.deepcopy(self.test_list) +new.test_list = copy.copy(self.test_list) new.forced_test_list = copy.copy(self.forced_test_list) new.filters = copy.copy(self.filters) return new -- 2.10.2 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit