Skip to content

Conversation

@marqh
Copy link
Member

@marqh marqh commented Jul 17, 2014

Speed up for PP and FieldsFiles where a constraint:

constraint = iris.AttributeConstraint(STASH='mXXsXXiXXX')

is used.

@rhattersley rhattersley changed the title Pp constraint PP constraint Jul 17, 2014
@rhattersley
Copy link
Member

👍 for the overall idea. It's something we've been kicking around for a long time, so it's nice to it finally come to pass in a simple, targeted form.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to raise an error here, nor is one wanted. When multiple STASH constraints are supplied the end result should be an empty "pp_constraints".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's another logic issue here. Supplying a known constraint and an unknown constraint will currently result in only fields with the matching STASH code passing the pre-filter, thus excluding fields which might match the unknown constraint.

Instead, whenever an unknown constraint is supplied the result of this function should be "allow everything".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When multiple STASH constraints are supplied the end result should be an empty "pp_constraints".

This could do with a test case.

@rhattersley
Copy link
Member

👍 for the overall idea. It's something we've been kicking around for a long time, so it's nice to it finally come to pass in a simple, targeted form.

Just to emphasise the benefit of @marqh's work here ... this makes a huge difference when picking a single STASH code out of a large collections of PP fields. @marqh has demonstrated a 20x speed-up for a real-world example. 😀

@marqh
Copy link
Member Author

marqh commented Jul 17, 2014

refactored to implement a field filter function as suggested

@esc24
Copy link
Member

esc24 commented Jul 17, 2014

@marqh has demonstrated a 20x speed-up for a real-world example.

🎉

@rhattersley
Copy link
Member

We should target v1.7.x with this as a way to combat some of the slowdowns that seem to have crept in.

@marqh marqh mentioned this pull request Jul 18, 2014
@davidSextonWork
Copy link

👍 from me too! Tests show reading in a pp field from a list of files which contain several fields is sped up by a factor of 12. This is the sort of a gain in performance that would really encourage users to take up Iris.

@marqh
Copy link
Member Author

marqh commented Jul 18, 2014

replaced by #1240 to target 1.7.x

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