opa icon indicating copy to clipboard operation
opa copied to clipboard

Defined check performance improvement

Open johanfylling opened this issue 2 years ago • 4 comments

When compared, avoiding realization of lazy types unless type of compared value supports a positive match. This removes type conversion cost of policies that only check presence of a value, but doesn't operate on it, e.:

package test

allow {
  data.collection
}

where data.collection is an object originating from a Store.

Also adding a lazyArray type, which solves for the same edge case as above, but where data.collection is an array.

Fixes: #5946.

johanfylling avatar Jun 22 '23 18:06 johanfylling

Deploy Preview for openpolicyagent ready!

Name Link
Latest commit f9f545f88d59e89e855fcefb76998f5727c5d193
Latest deploy log https://app.netlify.com/sites/openpolicyagent/deploys/651d5e690e0f2800088b1379
Deploy Preview https://deploy-preview-6040--openpolicyagent.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Jun 22 '23 18:06 netlify[bot]

💭 What does the naked ref get compiled to? When I was thinking about this problem before, I thought we might be able to figure it out in topdown: instead of retrieving the ref and comparing to to false, perhaps we could have a special case there where it's not going the ordinary route (InterfaceToValue), but special-cases the "exists and truthy" check on a lower level... 🤔 Am I making sense? I guess you've explored and dismissed this route before, just wondering.

srenatus avatar Jun 22 '23 18:06 srenatus

This pull request has been automatically marked as stale because it has not had any activity in the last 30 days.

stale[bot] avatar Aug 02 '23 13:08 stale[bot]

This pull request has been automatically marked as stale because it has not had any activity in the last 30 days.

stale[bot] avatar Nov 18 '23 11:11 stale[bot]

Closing this PR, as the breaking API changes makes it very unlikely that this will ever get merged. The lazy-object optimization has already been merged to main in #6060.

johanfylling avatar Apr 05 '24 13:04 johanfylling