[Piglit] [PATCH] framework/profile: don't deepcopy when copying profiles
mark.a.janes at intel.com
Tue Nov 15 22:38:39 UTC 2016
Tested-by: Mark Janes <mark.a.janes at intel.com>
Reviewed-by: Mark Janes <mark.a.janes at intel.com>
Dylan Baker <dylan at pnwbakers.com> 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 <mark.a.janes at intel.com>
> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> 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
More information about the Piglit