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

Support lift optimization for dag.Fork #5174

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Support lift optimization for dag.Fork #5174

merged 1 commit into from
Jul 11, 2024

Conversation

mattnibs
Copy link
Collaborator

@mattnibs mattnibs commented Jul 9, 2024

Also fixes bug where the lift optimization would not get applied on eligible sequences with a length of 2.

Closes #4559, closes #4503, closes #5070

@mattnibs mattnibs requested a review from a team July 9, 2024 21:30
Copy link
Member

@nwt nwt left a comment

Choose a reason for hiding this comment

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

If this closes #4559, then shouldn't it lift a into the fork here? Never mind me. It does lift a into the fork.

$ zc -C -O 'fork ( => pass => pass ) | where a'
reader
| fork (
  =>
    pass
  =>
    pass
)
| where a

@philrz
Copy link
Contributor

philrz commented Jul 11, 2024

Aww yeah! I saw the #5070 reference so I ran its repro steps on the branch to see it's really true. 11+ minutes down to <18 seconds. Nice work @mattnibs!

$ zed -version
Version: v1.16.0-13-gf45df62a

$ time zed query 'from * | CuYcyl29a2g8pYV1s'
{_path:"files",ts:2017-03-24T19:59:23.399396Z,fuid:"F4NAir1FuTH6Oax2J4",tx_hosts:|[184.72.208.63]|,rx_hosts:|[10.10.7.65]|,conn_uids:|["CuYcyl29a2g8pYV1s"]|,source:"HTTP",depth:0(uint64),analyzers:|["MD5","SHA1","SHA256"]|,mime_type:"text/json",filename:null(string),duration:0s,local_orig:null(bool),is_orig:false,seen_bytes:35(uint64),total_bytes:null(uint64),missing_bytes:0(uint64),overflow_bytes:0(uint64),timedout:false,parent_fuid:null(string),md5:"dd82bbeb20a441bf55e62d42255de7f4",sha1:"90b01d6f0c6891651e8a729892e92592dd581762",sha256:"da1791b1b8361af6383790c6e77ef6eb149b22ed7e2d59b61ac2deb7884edf4d",extracted:null(string),extracted_cutoff:null(bool),extracted_size:null(uint64)}
{_path:"http",ts:2017-03-24T19:59:23.306076Z,uid:"CuYcyl29a2g8pYV1s",id:{orig_h:10.10.7.65,orig_p:64135(port=uint16),resp_h:184.72.208.63,resp_p:80(port)},trans_depth:1(uint64),method:"GET",host:"lc68.dsr.livefyre.com",uri:"/livecountping/98236508/663740012478?__=bye2msvgpn91&routed=1&jid&siteId=366439&networkId=livefyre.com",referrer:"http://www.asigra.com/blog/what-multi-tenancy-how-secure-it",version:"1.1",user_agent:"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0",request_body_len:0(uint64),response_body_len:35(uint64),status_code:200(uint64),status_msg:"OK",info_code:null(uint64),info_msg:null(string),tags:|[]|(|[zenum=string]|),username:null(string),password:null(string),proxied:null(|[string]|),orig_fuids:null([string]),orig_filenames:null([string]),orig_mime_types:null([string]),resp_fuids:["F4NAir1FuTH6Oax2J4"],resp_filenames:null([string]),resp_mime_types:["text/json"]}
{_path:"conn",ts:2017-03-24T19:59:23.231562Z,uid:"CuYcyl29a2g8pYV1s",id:{orig_h:10.10.7.65,orig_p:64135(port=uint16),resp_h:184.72.208.63,resp_p:80(port)},proto:"tcp"(=zenum),service:"http",duration:182.422ms,orig_bytes:438(uint64),resp_bytes:588(uint64),conn_state:"SF",local_orig:null(bool),local_resp:null(bool),missed_bytes:0(uint64),history:"ShADadfF",orig_pkts:5(uint64),orig_ip_bytes:650(uint64),resp_pkts:5(uint64),resp_ip_bytes:800(uint64),tunnel_parents:null(|[string]|)}

real	0m17.778s
user	0m0.033s
sys	0m0.037s

@mattnibs mattnibs merged commit d038788 into main Jul 11, 2024
3 checks passed
@mattnibs mattnibs deleted the fork-lift branch July 11, 2024 17:13
nwt added a commit that referenced this pull request Aug 2, 2024
This test went flaky with #5174 because the optimizer began lifting the
head operator into the legs of the fork operator, causing the pass leg
to stop pulling until EOS.
nwt added a commit that referenced this pull request Aug 2, 2024
This test went flaky with #5174 because the optimizer began lifting the
head operator into the legs of the fork operator, causing the pass leg
to stop pulling until EOS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants