Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSS export #138

Merged
merged 38 commits into from
Nov 30, 2021
Merged

OSS export #138

merged 38 commits into from
Nov 30, 2021

Conversation

kyessenov
Copy link
Collaborator

@kyessenov kyessenov commented Nov 30, 2021

No description provided.

@google-cla google-cla bot added the cla: yes CLA present label Nov 30, 2021
TristonianJones and others added 4 commits November 30, 2021 15:54
Refactor tests to parse CEL expressions where possible.

PiperOrigin-RevId: 402326925
PiperOrigin-RevId: 402355888
…ting missing attribute errors.

PiperOrigin-RevId: 402671509
@google-cla google-cla bot added the cla: no CLA not present label Nov 30, 2021
…his change retains current calls to Arg callbacks for now but they might be deprecated in the future.

The choice between old and new flow is made through the option argument supplied to
AstTraverse method. By default, the option invokes the legacy flow

PiperOrigin-RevId: 403419776
@google-cla google-cla bot removed the cla: yes CLA present label Nov 30, 2021
CEL Dev Team and others added 21 commits November 30, 2021 15:54
Fix a typo "requst" -> "request" in `eval/tests/benchmark_test.cc`.

PiperOrigin-RevId: 404343125
This change introduces a `MutableListImpl` creation step when a comprehension
contains a `CreateList` step for the `accu_init` expression.

Within the function call processing, list concatenation function calls are
switched to a private runtime-only `#list_append`. For `map` macros, the
list concatenation is the `loop_step`. For `filter` macros, the list
concatenation appears within a ternary `filter ? result + [expr] : result`.

At present the code is only optimized to handle these two cases. Custom
macros cannot benefit from this specialized handling. As a future alternative
consider introducing a `@mutable_list` and `@list_append` functions so that
custom macro authors may also provide more memory efficient comprehensions.

Performance advantages increase dramatically with the size of the
comprehension iteration range, with benefits >10% for 8 element
lists and >400% for 512 element lists.

PiperOrigin-RevId: 404378962
PiperOrigin-RevId: 404634380
…y for

hand-crafted ASTs.

It is possible for an accumulation variable in a comprehension to be
referenced more than once in the `loop_step` of a comprehension. Sometimes
this is fine, as is the case within the ternary operation `?:` which either
appends to the accumulation variable or returns the existing value. In other
cases, such as `+`, it is possible for the value to grow and allocate
exponentially, e.g.

```
    iter_range: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    accu_init: ["hello"],
    accu_var: "accu",
    loop_step: accu + accu
    loop_condition: accu == accu
```

In the example, the size of the `accu` grows to 2^iter_range elements.

Within parser generated comprehensions generated by the core CEL libraries,
such expressions are impossible. But in hand-rolled ASTs, it is very easy to
induce memory explosion.

PiperOrigin-RevId: 404640801
…arser_internal`

PiperOrigin-RevId: 404645986
PiperOrigin-RevId: 404687396
…get arguments and list literals

PiperOrigin-RevId: 404808052
Enable the option `enable_comprehension_list_append` in benchmarks. If not enabled, the `BM_ListComprehension/64K` benchmark will need >50G memory to complete.

PiperOrigin-RevId: 404857074
…lr4::CharStream` implementation to C++

PiperOrigin-RevId: 405979068
Also, use pointer equality rather than ids to ensure that the objects
which are intended for use by this optimization are the ones that
receive it.

PiperOrigin-RevId: 406184880
Add benchmarks function for the trace mode with an empty callback function.

PiperOrigin-RevId: 406261355
Additional changes were made to ensure that a mutable list is only
created based on the equality of an expression address, rather than
and expression id (which may be missing). And `down_cast` is used
over `static_cast` to ensure such issues surface sooner.

PiperOrigin-RevId: 406379960
…value.

This cuts about 4kB from the size of the conformance/server binary.

PiperOrigin-RevId: 407111333
PiperOrigin-RevId: 408360084
variables within comprehensions.

The storage and retrieval of these values in maps is significantly
more costly than retaining a specialize struct.

PiperOrigin-RevId: 409298483
jcking and others added 11 commits November 30, 2021 15:56
PiperOrigin-RevId: 410265860
PiperOrigin-RevId: 410835255
PiperOrigin-RevId: 410901267
… lookup step and upcoming name resolution step.

PiperOrigin-RevId: 411669863
PiperOrigin-RevId: 411852738
PiperOrigin-RevId: 413219280
@kyessenov kyessenov changed the title Remove external UTF-8 handling dependency by implementing UTF-8 handling internally OSS export Nov 30, 2021
@kyessenov kyessenov requested review from TristonianJones and jcking and removed request for TristonianJones November 30, 2021 21:00
@kyessenov kyessenov added cla: yes CLA present and removed cla: no CLA not present labels Nov 30, 2021
@kyessenov kyessenov merged commit ab12523 into master Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA present
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants