@leostera This is awesome sauce! I think the situation has improved for me but not entirely.
I still see an issue from #34 but it happens not so frequently to me. Previously, I had to restart my app 7 times to avoid hanging. Now I need to restart it 7 times to observe hanging, which is an improvement!
At this point, I started thinking that my view function may generate lots of garbage, and the GC struggles to process everything at 60 FPS (default).
I wonder if Mint Tea can add something like has_diff : 'model -> 'model -> bool to t
|
type 'model t = { |
|
init : 'model -> Command.t; |
|
update : Event.t -> 'model -> 'model * Command.t; |
|
view : 'model -> string; |
|
} |
So that it can avoid calling view entirely if the model didn't change unlike the current implementation where we compare already rendered buffer:
|
let same_as_last_flush t = t.buffer = t.last_render |
Alternatively, exposing the fps setting from start may help app developers reduce their resource usage (I don't really need 60 fps)
|
let run ?(fps = 60) ~initial_model app = |
|
let prog = Program.make ~app ~fps in |
|
Program.run prog initial_model; |
|
Logger.trace (fun f -> f "terminating") |
|
|
|
let start app ~initial_model = |
|
let module App = struct |
|
let start () = |
|
Logger.set_log_level None; |
|
let pid = |
|
spawn_link (fun () -> |
|
run app ~initial_model; |
|
Logger.trace (fun f -> f "about to shutdown"); |
|
shutdown ~status:0 ()) |
|
in |
|
Ok pid |
|
end in |
|
Riot.start ~apps:[ (module Riot.Logger); (module App) ] () |
Originally posted by @chshersh in #38 (comment)
I still see an issue from #34 but it happens not so frequently to me. Previously, I had to restart my app 7 times to avoid hanging. Now I need to restart it 7 times to observe hanging, which is an improvement!
At this point, I started thinking that my
viewfunction may generate lots of garbage, and the GC struggles to process everything at 60 FPS (default).I wonder if Mint Tea can add something like
has_diff : 'model -> 'model -> booltotminttea/minttea/app.ml
Lines 1 to 5 in 3e38613
So that it can avoid calling
viewentirely if themodeldidn't change unlike the current implementation where we compare already rendered buffer:minttea/minttea/renderer.ml
Line 26 in 3e38613
Alternatively, exposing the
fpssetting fromstartmay help app developers reduce their resource usage (I don't really need 60 fps)minttea/minttea/minttea.ml
Lines 9 to 26 in 3e38613
Originally posted by @chshersh in #38 (comment)