Skip to content

Conversation

@Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Dec 7, 2016

The performance and allocations fixes in #2235 also introduced virality
on the QueryContainer when using &= assignment. The composed result was
correct but the QueryContainer composed of &= would be left marked as
CreatedByTheBoolDsl which meant it was marked for reuse.

If you then later combined it with && (e.g andAssignedQuery && newQuery) the resulting
query would be correct but if you rely on andAssignedQuery not being
mutated you'd be in for a nasty suprise.

A QueryContainer composed with && did not expose the same virality
problems.

This was due to a difference in how the & operator overload on QueryContainer and QueryBase behaved.

Removed the notion of trying to reuse all together since the big
performance gain from #2235 is that we can flatten many boolean should
queries using &= or && or visa versa many boolean must queries with
|= or ||.

The performance and allocations fixes in #2235 also introduced virality
on the QueryContainer when using &= assignment. The composed result was
correct but the QueryContainer composed of `&=` would be left marked as
`CreatedByTheBoolDsl` which meant it was marked for reuse.

If you then later combined it with && (andAssignedQuery && newQuery) the resulting
query would be correct but if you rely on `andAssignedQuery` not being
mutated you'd be in for a nasty suprise.

A QueryContainer composed with `&&` did not expose the same virality
problems.

Removed the notion of trying to reuse all together since the big
performance gain from #2235 is that we can flatten many boolean should
queries using `&=` or `&&` or visa versa many boolean must queries with
`|=` or `||`.
@russcam russcam force-pushed the fix/bool-composition-pure branch from 857bb02 to c5e6bea Compare December 9, 2016 05:34
@russcam russcam merged commit c5e6bea into master Dec 9, 2016
@russcam russcam added the v5.0.0 label Dec 13, 2016
@Mpdreamz Mpdreamz deleted the fix/bool-composition-pure branch January 23, 2017 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants