From dfecb3a1cb33f65209368a8ff56494163f631b0e Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 12 Dec 2018 00:37:56 -0500 Subject: [PATCH 1/3] refactors event poke, removing unnecessary effect traversal --- vere/raft.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/vere/raft.c b/vere/raft.c index e4134c29ad..508dddb6da 100644 --- a/vere/raft.c +++ b/vere/raft.c @@ -1601,38 +1601,26 @@ _raft_punk(u3_noun ovo) free(txt_c); #endif - if ( u3_blip != u3h(gon) ) { - u3_noun why = u3k(u3h(gon)); - u3_noun tan = u3k(u3t(gon)); + { + u3_noun hed, tal; + u3x_cell(gon, &hed, &tal); + u3k(hed); u3k(tal); u3z(gon); - return _raft_lame(ovo, why, tan); - } - else { - u3_noun vir = u3k(u3h(u3t(gon))); - u3_noun cor = u3k(u3t(u3t(gon))); - u3_noun nug; - u3z(gon); - nug = u3v_nick(vir, cor); - - if ( u3_blip != u3h(nug) ) { - u3_noun why = u3k(u3h(nug)); - u3_noun tan = u3k(u3t(nug)); - - u3z(nug); - return _raft_lame(ovo, why, tan); + if ( u3_blip != hed ) { + return _raft_lame(ovo, hed, tal); } else { - vir = u3k(u3h(u3t(nug))); - cor = u3k(u3t(u3t(nug))); + u3_noun vir, cor; + u3x_cell(tal, &vir, &cor); + + u3k(vir); u3k(cor); + u3z(tal); - u3z(nug); return _raft_sure(ovo, vir, cor); } } - // uL(fprintf(uH, "punk oot %s\n", txt_c)); - // free(txt_c); } /* _raft_push(): save an event From a848191c504082378d2ac2599a0ad6428b6936cc Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 12 Dec 2018 00:39:31 -0500 Subject: [PATCH 2/3] refactors event replay, removing unnecessary effect traversal --- vere/sist.c | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/vere/sist.c b/vere/sist.c index e14b5bdb1c..f20b1d4b22 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -237,42 +237,42 @@ _sist_sing(u3_noun ovo) { u3_noun gon = u3m_soft(0, u3v_poke, u3k(ovo)); - if ( u3_blip != u3h(gon) ) { - _sist_suck(ovo, gon); - } - else { - u3_noun vir = u3k(u3h(u3t(gon))); - u3_noun cor = u3k(u3t(u3t(gon))); - u3_noun nug; + { + u3_noun hed, tal; + u3x_cell(gon, &hed, &tal); - u3z(gon); - nug = u3v_nick(vir, cor); - - if ( u3_blip != u3h(nug) ) { - _sist_suck(ovo, nug); + if ( u3_blip != hed ) { + _sist_suck(ovo, gon); } else { - vir = u3h(u3t(nug)); - cor = u3k(u3t(u3t(nug))); + u3_noun vir, cor; + u3x_cell(tal, &vir, &cor); - while ( u3_nul != vir ) { - u3_noun fex = u3h(vir); - u3_noun fav = u3t(fex); - - if ( c3__init == u3h(fav) ) { - u3A->own = u3k(u3t(fav)); - // note: c3__boot == u3h(u3t(ovo)) - u3A->fak = ( c3__fake == u3h(u3t(u3t(ovo))) ) ? c3y : c3n; - } - - vir = u3t(vir); - } - u3z(nug); u3z(u3A->roc); - u3A->roc = cor; + u3A->roc = u3k(cor); + + { + u3_noun tag, dat; + u3x_trel(ovo, 0, &tag, &dat); + + if ( c3__boot == tag ) { + while ( u3_nul != vir ) { + u3_noun fav = u3t(u3h(vir)); + + if ( c3__init == u3h(fav) ) { + u3A->own = u3k(u3t(fav)); + u3A->fak = ( c3__fake == u3h(tag) ) ? c3y : c3n; + } + + vir = u3t(vir); + } + } + } } - u3z(ovo); } + + u3z(gon); + u3z(ovo); } /* _sist_cask(): ask for a passcode. From f18d6cbc103e0457c8da9b21e48af023415b4d44 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 12 Dec 2018 00:40:04 -0500 Subject: [PATCH 3/3] removes unused u3v_nick (effect traversal) and u3v_http_request --- include/noun/vortex.h | 10 ------- noun/vortex.c | 67 ------------------------------------------- 2 files changed, 77 deletions(-) diff --git a/include/noun/vortex.h b/include/noun/vortex.h index d84dbf2c60..dfb7e8bae4 100644 --- a/include/noun/vortex.h +++ b/include/noun/vortex.h @@ -84,11 +84,6 @@ u3_noun u3v_pike(u3_noun ovo, u3_noun cor); - /* u3v_nick(): transform enveloped packets, [vir cor]. - */ - u3_noun - u3v_nick(u3_noun vir, u3_noun cor); - /* u3v_do(): use a kernel function. */ u3_noun @@ -119,11 +114,6 @@ u3_noun u3v_poke(u3_noun ovo); - /* u3v_http_request(): hear http request on channel (unprotected). - */ - void - u3v_http_request(c3_o sec, u3_noun pox, u3_noun req); - /* u3v_tank(): dump single tank. */ void diff --git a/noun/vortex.c b/noun/vortex.c index a23f95f30b..c40fd3fcf9 100644 --- a/noun/vortex.c +++ b/noun/vortex.c @@ -139,64 +139,6 @@ u3v_pike(u3_noun ovo, u3_noun cor) return _cv_mung(0, fun, sam); } -/* u3v_nick(): transform enveloped packets, [vir cor]. -*/ -u3_noun -u3v_nick(u3_noun vir, u3_noun cor) -{ - if ( u3_nul == vir ) { - return u3nt(u3_blip, vir, cor); - } - else { - u3_noun i_vir = u3h(vir); - u3_noun pi_vir, qi_vir; - u3_noun vix; - - if ( (c3y == u3r_cell(i_vir, &pi_vir, &qi_vir)) && - (c3y == u3du(qi_vir)) && - (c3__hear == u3h(qi_vir)) ) - { - u3_noun gon; - - gon = u3v_pike(u3k(i_vir), cor); - if ( u3_blip != u3h(gon) ) { - u3z(vir); - return gon; - } - else { - u3_noun viz; - - vix = u3k(u3h(u3t(gon))); - cor = u3k(u3t(u3t(gon))); - u3z(gon); - - viz = u3kb_weld(vix, u3k(u3t(vir))); - u3z(vir); - - return u3v_nick(viz, cor); - } - } - else { - u3_noun nez = u3v_nick(u3k(u3t(vir)), cor); - - if ( u3_blip != u3h(nez) ) { - u3z(vir); - return nez; - } else { - u3_noun viz; - - viz = u3nc(u3k(i_vir), u3k(u3h(u3t(nez)))); - cor = u3k(u3t(u3t(nez))); - - u3z(vir); - u3z(nez); - - return u3nt(u3_blip, viz, cor); - } - } - } -} - /* _cv_nock_poke(): call poke through hardcoded interface. */ static u3_noun @@ -374,15 +316,6 @@ u3v_poke(u3_noun ovo) return _cv_nock_poke(ovo); } -/* u3v_http_request(): hear http request on channel (unprotected). -*/ -void -u3v_http_request(c3_o sec, u3_noun pox, u3_noun req) -{ - // uL(fprintf(uH, "http: request\n")); - u3v_plan(pox, u3nq(c3__this, sec, 0, req)); -} - /* u3v_tank(): dump single tank. */ void