terminal user interface to jujutsu. Focused on speed and clarity
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

Optimize startup time

+18 -7
+1 -1
jj_tui/bin/global_funcs.ml
··· 14 14 ;; 15 15 16 16 let check_startup () = 17 - match jj_no_log_errorable ~color:false [ "log"; "''" ] with 17 + match jj_no_log_errorable ~color:false ~snapshot:false [ "op";"log"; "-l";"0" ] with 18 18 | Ok _ -> 19 19 `Good 20 20 | Error (`BadExit (i, str)) ->
+8
jj_tui/bin/jj_process.ml
··· 143 143 144 144 (* Ui_loop.run (Lwd.pure (W.printf "Hello world"));; *) 145 145 let cmdArgs cmd args = 146 + let start_time = Unix.gettimeofday () in 146 147 let code, status, out_content, err_content = picos_process cmd args in 148 + let end_time = Unix.gettimeofday () in 149 + [%log 150 + debug 151 + "Executing '%s %s' took: %fms " 152 + cmd 153 + (args |> String.concat " ") 154 + ((end_time -. start_time) *. 1000.)]; 147 155 let exit_code = 148 156 match status with 149 157 | Unix.WEXITED code ->
+1 -1
jj_tui/bin/jj_ui.ml
··· 171 171 (*we want to initialize our states and keep them up to date*) 172 172 match check_startup () with 173 173 | `Good -> 174 - update_status ~cause_snapshot:true (); 174 + (* update_status ~cause_snapshot:true (); *) 175 175 Flock.fork (fun () -> 176 176 while true do 177 177 Picos.Fiber.sleep ~seconds:5.0;
+2 -2
jj_tui/bin/main.ml
··· 30 30 let rec loop () = 31 31 if not (Lwd.peek quit) 32 32 then ( 33 - let start_time = Sys.time () in 33 + let start_time = Unix.gettimeofday() in 34 34 let term_width, term_height = Notty_unix.Term.size (Vars.get_term ()) in 35 35 let prev_term_width, prev_term_height = Lwd.peek Vars.term_width_height in 36 36 if term_width <> prev_term_width || term_height <> prev_term_height ··· 44 44 (*Sleep for a bit to stop spinning the cpu 45 45 TODO: May not be needed, nottui may sleep for a bit anyway 46 46 *) 47 - let end_time = Sys.time () in 47 + let end_time = Unix.gettimeofday () in 48 48 let elapsed = end_time -. start_time in 49 49 let sleep_time = max 0.01 (0.01 -. elapsed) in 50 50 Picos_io.Unix.sleepf sleep_time;
+6 -3
jj_tui/lib/process_wrappers.ml
··· 6 6 open! Util 7 7 open Process 8 8 open Logging 9 + open Picos_std_structured 9 10 10 11 exception FoundStart 11 12 exception FoundFiller ··· 211 212 212 213 (** returns the graph and a list of revs within that graph*) 213 214 let graph_and_revs ?revset () = 214 - let selectable_count, graph = 215 + let graph = 216 + Flock.fork_as_promise @@ fun () -> 215 217 let revset_arg = match revset with Some revset -> [ "-r"; revset ] | None -> [] in 216 218 let output = jj_no_log ([ "log" ] @ revset_arg) in 217 219 output |> find_selectable_from_graph 218 - in 219 - let revs = get_revs ?revset () in 220 + and revs = Flock.fork_as_promise @@ fun () -> get_revs ?revset () in 221 + let selectable_count, graph = Promise.await graph 222 + and revs = Promise.await revs in 220 223 (*The graph should never have selectable items that don't also have a rev*) 221 224 222 225 (* TODO: remove this becasue it's just for debugging*)