Are there any known issues, best practices, or limitations when dealing with large data structures in the app-db? I haven't found any other discussions around this. For example, I have an application which can load up to ~200MB JSON document from a web service that contains metadata about things that I'd like to allow users to explore in the re-frame app. Should I preprocess this response before putting it into the app-db? Avoid too many subscriptions with the response's layer 2 subscription as input?
Have you noticed any performance issues? In my experience you can deal with problems like these as they pop up since moving logic from subscriptions to some "preprocessing" step in an event tends to not be too terrible
Yeah, a performance issue is what caused us to look into it. The user's browser tab with the application crashed due to too much memory usage. > moving logic from subscriptions to some "preprocessing" step in an event tends to not be too terrible Yeah, we went ahead and did this since it seemed like it allowed the memory usage to go down (the peak in both cases were the same, but after garbage collection, it was lower when storing the preprocessed instead)
hash maps get less performant the bigger they grow. you might consider using a data structure that doesn't involve structural sharing (e.g. a plain JS object) if you're running into performance problems
especially if you're not modifying the metadata in the app, using immutable data is a bit of a waste.
ultimately you'll want to profile your app and see where the performance is being bottlenecked
Hi, is there a template for re-frame apps similar to https://github.com/day8/re-frame-template but if you don't want to use Leiningen?
Actually the template you linked doesn't use leiningen, unless I'm reading the README wrong
It says it includes:
re-frame
shadow-cljs
cljs-devtools
The readme does say to use lein
to install the template, but you can avoid it by using https://github.com/seancorfield/clj-new if you use tool deps instead
Thanks for the responses!
@dromar56 yes, you can generate the template using clj-new
but you end up with a leiningen project, just scroll down in that readme and see how you would Run the application. lein deps
, lein watch
etc.
@claudius.nicolae I love that animated gif in your README https://github.com/tape-framework/doc 😄
https://github.com/tape-framework/clj-template but it's not plain re-frame and it's pre.alpha
Tutorial here: https://github.com/tape-framework/doc/blob/master/docs/Tutorial.md