-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance with large numbers of reference sequences by using MST volatiles #2060
Conversation
6f12a2a
to
d017965
Compare
Ref for types.frozens https://mobx-state-tree.js.org/overview/types |
probably the only downside is "if the regions of the assembly object was mutated, it wouldn't pick it up" but you could "reassign the regions object and it would work fine" example showing to actually reassigning the frozen is fine there are also some places in the code that currently assumes it has to getSnapshot(assembly.regions) to deserialize them, and this would now throw an error saying assembly.regions is not an mst object, but those errors can be fixed |
note that we generally don't even reassign an assemblies regions object anyways, but just wanted to show that example |
in general, using a types.frozen seems like it can can be a good option for storing "bigdata" objects in the mst tree that aren't really things that we edit |
it could possibly be stored in a volatile as an alternative too, as we may not rely on serializing these into snapshots |
Sounds reasonable to me, any reason it's still marked as draft? Is there any live editing of the contents of the frozen that we can think of? |
d017965
to
e20b7fe
Compare
It needed a couple more fixes to not use getSnapshot for the assembly region objects, but it should be ready probably now |
97df17c
to
49094a7
Compare
Codecov Report
@@ Coverage Diff @@
## main #2060 +/- ##
==========================================
- Coverage 61.30% 61.26% -0.05%
==========================================
Files 480 480
Lines 22981 22956 -25
Branches 5271 5266 -5
==========================================
- Hits 14088 14063 -25
Misses 8618 8618
Partials 275 275
Continue to review full report at Codecov.
|
Return type of exported function has or is using name '$ "stateTreeNodeType'"
f7d01ee
to
8ed5e00
Compare
I changed this to use volatiles instead of types.frozen. It would work with types.frozen still, but I think it is helpful for the "clarity of thought" for the app to use volatiles here. We don't expect or allow serializing the assembly regions so it is not really required to be part of the app model. |
This is a possible proposal to help speed up large assemblies
This demo has 200,000 contigs
https://s3.amazonaws.com/jbrowse.org/code/jb2/main/index.html?config=test_data%2Fconfig_many_contigs.json
This can hang the page for as much as 10 seconds on a fast machine, production build
After this change the load time is about 3 seconds, with the code that does this coming from refNameAliases instead of assembly.regions now, so probably can be reduced more
This is an early proof of concept PR but note that types.frozens can also be typescripted
Possible help for #1847