(command.CommandList children: [ (C {(Id.KW_Set set)} {(-o)} {(nounset)}) (C {(Id.KW_Set set)} {(-o)} {(pipefail)}) (C {(Id.KW_Set set)} {(-o)} {(errexit)}) (C {(source)} {(test/common.sh)}) (C {(source)} {(benchmarks/common.sh)}) (C {(readonly)} {(Id.Lit_VarLike 'BASE_DIR=') (_tmp/oheap)}) (command.ShFunction name: encode-one body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'script=') ($ Id.VSub_Number '$1')}) (C {(local)} {(Id.Lit_VarLike 'oheap_out=') ($ Id.VSub_Number '$2')}) (command.Simple words: [ {($ Id.VSub_DollarName '$OSH_OVM')} {(-n)} {(--ast-format)} {(oheap)} {(DQ ($ Id.VSub_DollarName '$script'))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:84) fd: -1 arg_word: {($ Id.VSub_DollarName '$oheap_out')} ) ] ) ] ) ) (command.ShFunction name: task-spec body: (command.BraceGroup children: [ (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:98) cond: [ (command.Sentence child: (C {(read)} {(path)}) terminator: (Token id:Id.Op_Semi val:';' span_id:103) ) ] body: (command.DoGroup children: [ (C {(echo)} { (DQ ($ Id.VSub_DollarName '$path') (' _tmp/oheap/') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:113) command_list: (command.CommandList children: [(C {(basename)} {($ Id.VSub_DollarName '$path')})] ) ) (__oheap) ) } ) ] ) redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:124) fd: -1 arg_word: {(benchmarks/osh-parser-files.txt)} ) ] ) ] ) ) (command.ShFunction name: encode-all body: (command.BraceGroup children: [ (C {(mkdir)} {(-p)} {(_tmp/oheap)}) (C {(local)} {(Id.Lit_VarLike 'times_csv=') (_tmp/oheap/times.csv)}) (command.Simple words: [{(echo)} {(SQ (Token id:Id.Lit_Chars val:'status,elapsed_secs' span_id:156))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:159) fd: -1 arg_word: {($ Id.VSub_DollarName '$times_csv')} ) ] ) (command.Pipeline children: [ (C {(task-spec)}) (C {(xargs)} {(-n)} {(2)} {(--verbose)} {(--)} {(benchmarks/time.py)} {(--output)} {($ Id.VSub_DollarName '$times_csv')} {(--)} {($ Id.VSub_Number '$0')} {(encode-one)} ) ] negated: F ) ] ) ) (command.ShFunction name: compress-oheap body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'c_dir=') ($ Id.VSub_DollarName '$BASE_DIR') (/oheap-compressed)} ) (C {(mkdir)} {(-p)} {($ Id.VSub_DollarName '$c_dir')}) (command.ForEach iter_name: bin iter_words: [{(_tmp/oheap/) (Id.Lit_Star '*') (__oheap)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(local)} {(Id.Lit_VarLike 'name=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:240) command_list: (command.CommandList children: [(C {(basename)} {($ Id.VSub_DollarName '$bin')})] ) ) } ) (C {(log)} {(DQ ('Compressing ') ($ Id.VSub_DollarName '$name'))}) (command.Simple words: [{(gzip)} {(--stdout)} {($ Id.VSub_DollarName '$bin')}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:261) fd: -1 arg_word: {($ Id.VSub_DollarName '$c_dir') (/) ($ Id.VSub_DollarName '$name') (.gz)} ) ] ) (command.Simple words: [{(xz)} {(--stdout)} {($ Id.VSub_DollarName '$bin')}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:275) fd: -1 arg_word: {($ Id.VSub_DollarName '$c_dir') (/) ($ Id.VSub_DollarName '$name') (.xz)} ) ] ) ] ) ) ] ) ) (command.ShFunction name: compress-text body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'c_dir=') ($ Id.VSub_DollarName '$BASE_DIR') (/src-compressed)} ) (C {(mkdir)} {(-p)} {($ Id.VSub_DollarName '$c_dir')}) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:310) cond: [ (command.Sentence child: (C {(read)} {(src)}) terminator: (Token id:Id.Op_Semi val:';' span_id:315) ) ] body: (command.DoGroup children: [ (C {(local)} {(Id.Lit_VarLike 'name=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:323) command_list: (command.CommandList children: [(C {(basename)} {($ Id.VSub_DollarName '$src')})] ) ) } ) (C {(log)} {(DQ ('Compressing ') ($ Id.VSub_DollarName '$name'))}) (command.Simple words: [{(gzip)} {(--stdout)} {($ Id.VSub_DollarName '$src')}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:344) fd: -1 arg_word: {($ Id.VSub_DollarName '$c_dir') (/) (${ Id.VSub_Name name) (__text.gz)} ) ] ) (command.Simple words: [{(xz)} {(--stdout)} {($ Id.VSub_DollarName '$src')}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:360) fd: -1 arg_word: {($ Id.VSub_DollarName '$c_dir') (/) (${ Id.VSub_Name name) (__text.xz)} ) ] ) ] ) redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:372) fd: -1 arg_word: {(benchmarks/osh-parser-files.txt)} ) ] ) ] ) ) (command.ShFunction name: print-size body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'c1=') ($ Id.VSub_Number '$1')}) (C {(local)} {(Id.Lit_VarLike 'c2=') ($ Id.VSub_Number '$2')}) (C {(shift)} {(2)}) (C {(find)} {(DQ ($ Id.VSub_At '$@'))} {(-maxdepth)} {(0)} {(-printf)} { (DQ ('%s,') ($ Id.VSub_DollarName '$c1') (',') ($ Id.VSub_DollarName '$c2') (',%p') (Id.Lit_Other '\\') (n) ) } ) ] ) ) (command.ShFunction name: print-csv body: (command.BraceGroup children: [ (C {(echo)} {(SQ (Token id:Id.Lit_Chars val:'num_bytes,format,compression,path' span_id:444))} ) (C {(print-size)} {(text)} {(none)} {(benchmarks/testdata/) (Id.Lit_Star '*')}) (C {(print-size)} {(text)} {(gz)} {($ Id.VSub_DollarName '$BASE_DIR') (/src-compressed/) (Id.Lit_Star '*') (.gz)} ) (C {(print-size)} {(text)} {(xz)} {($ Id.VSub_DollarName '$BASE_DIR') (/src-compressed/) (Id.Lit_Star '*') (.xz)} ) (C {(print-size)} {(oheap)} {(none)} {($ Id.VSub_DollarName '$BASE_DIR') (/) (Id.Lit_Star '*') (__oheap)} ) (C {(print-size)} {(oheap)} {(gz)} {($ Id.VSub_DollarName '$BASE_DIR') (/oheap-compressed/) (Id.Lit_Star '*') (.gz)} ) (C {(print-size)} {(oheap)} {(xz)} {($ Id.VSub_DollarName '$BASE_DIR') (/oheap-compressed/) (Id.Lit_Star '*') (.xz)} ) ] ) ) (command.ShFunction name: measure body: (command.BraceGroup children: [(C {(encode-all)}) (C {(compress-oheap)}) (C {(compress-text)})] ) ) (command.ShFunction name: stage1 body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'out_dir=') ($ Id.VSub_DollarName '$BASE_DIR') (/stage1)}) (C {(mkdir)} {(-p)} {($ Id.VSub_DollarName '$out_dir')}) (command.Simple words: [{(print-csv)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:570) fd: -1 arg_word: {($ Id.VSub_DollarName '$out_dir') (/sizes.csv)} ) ] ) ] ) ) (command.ShFunction name: print-report body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'in_dir=') ($ Id.VSub_Number '$1')}) (C {(local)} {(Id.Lit_VarLike 'base_url=') (SQ (Token id:Id.Lit_Chars val:../../web span_id:595))} ) (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:602) fd: -1 here_begin: {(EOF)} here_end_span_id: 667 stdin_parts: [ ('<!DOCTYPE html>\n') ('<html>\n') (' <head>\n') (' <title>OHeap Encoding</title>\n') (' <script type=') (Id.Right_DoubleQuote '"') (text/javascript) (Id.Right_DoubleQuote '"') (' src=') (Id.Right_DoubleQuote '"') ($ Id.VSub_DollarName '$base_url') (/table/table-sort.js) (Id.Right_DoubleQuote '"') ('></script>\n') (' <link rel=') (Id.Right_DoubleQuote '"') (stylesheet) (Id.Right_DoubleQuote '"') (' type=') (Id.Right_DoubleQuote '"') (text/css) (Id.Right_DoubleQuote '"') (' href=') (Id.Right_DoubleQuote '"') ($ Id.VSub_DollarName '$base_url') (/table/table-sort.css) (Id.Right_DoubleQuote '"') (' />\n') (' <link rel=') (Id.Right_DoubleQuote '"') (stylesheet) (Id.Right_DoubleQuote '"') (' type=') (Id.Right_DoubleQuote '"') (text/css) (Id.Right_DoubleQuote '"') (' href=') (Id.Right_DoubleQuote '"') ($ Id.VSub_DollarName '$base_url') (/benchmarks.css) (Id.Right_DoubleQuote '"') (' />\n') ('\n') (' </head>\n') (' <body>\n') (' <p id=') (Id.Right_DoubleQuote '"') (home-link) (Id.Right_DoubleQuote '"') ('>\n') (' <a href=') (Id.Right_DoubleQuote '"') (/) (Id.Right_DoubleQuote '"') ('>oilshell.org</a>\n') (' </p>\n') (' <h2>OHeap Encoding</h2>\n') ('\n') (' <h3>Encoding Size (KB)</h3>\n') ('\n') (' <p>Sizes are in KB (powers of 10), not KiB (powers of 2).</p>\n') ] ) ] ) (C {(csv2html)} {($ Id.VSub_DollarName '$in_dir') (/encoding_size.csv)}) (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:678) fd: -1 here_begin: {(EOF)} here_end_span_id: 683 stdin_parts: [(' <h3>Encoding Ratios</h3>\n')] ) ] ) (C {(csv2html)} {($ Id.VSub_DollarName '$in_dir') (/encoding_ratios.csv)}) (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:694) fd: -1 here_begin: {(EOF)} here_end_span_id: 700 stdin_parts: [(' </body>\n') ('</html>\n')] ) ] ) ] ) ) (command.ShFunction name: decode body: (command.BraceGroup children: [ (command.ForEach iter_name: bin iter_words: [{(_tmp/oheap/) (Id.Lit_Star '*') (.oheap)}] do_arg_iter: F body: (command.DoGroup children: [ (command.TimeBlock pipeline: (command.Pipeline children: [ (C {(_tmp/osh_demo)} {($ Id.VSub_DollarName '$bin')}) (C {(wc)} {(-l)}) ] negated: F ) ) ] ) ) ] ) ) (C {(DQ ($ Id.VSub_At '$@'))}) ] )