Fix very slow unit-test data generation in some cases
authorIustin Pop <iustin@google.com>
Fri, 13 Jan 2012 14:44:37 +0000 (15:44 +0100)
committerIustin Pop <iustin@google.com>
Fri, 13 Jan 2012 14:58:50 +0000 (15:58 +0100)
commit7806125e213090ac42dfa68d4450d2ca7b84f7e9
tree9fe2862e7322eae31344d08ef0035a09501e458a
parent746b7aa60e6d574a66a29549d0e40d4c34cb0cf8
Fix very slow unit-test data generation in some cases

Learning, learning. It turns out that for objects with even just five
fields, generating them and filtering can be costly, especially when
the filtering is nested (as it was in this case, arbitrary1 →
arbitrary2 + filter on arbitrary1 → arbitrary plus filter on
aribitrary2).

Changing the code to generate directly the good values speeds things
up significantly. Additionally, we also generate correctly unique
lists of disk templates (again, this should be a set, not a list,
but…).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
htools/Ganeti/HTools/QC.hs