[Piglit] [PATCH] framework/profile: don't deepcopy when copying profiles

Dylan Baker dylan at pnwbakers.com
Tue Nov 15 21:32:36 UTC 2016


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 <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

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
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20161115/489fefe1/attachment.sig>


More information about the Piglit mailing list