geneontology / minerva

BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

In some cases, large models significantly slow minerva #467

Closed kltm closed 2 years ago

kltm commented 2 years ago

For example:

http://noctua-dev.berkeleybop.org/editor/graph/gomodel:5b318d0900000194

It's possible that this is an issue in minerva. @balhoff

kltm commented 2 years ago

From @balhoff "I narrowed it down to this method...": //TODO this loop is the slowest part of the service response time. https://github.com/geneontology/minerva/blob/7a068ed41dc9a95652e25cba73c60ead9a214e23/minerva-core/src/main/java/org/geneontology/minerva/json/MolecularModelJsonRenderer.java#L92

balhoff commented 2 years ago

A partial fix, removing the biggest slowdown in the code path, is implemented in #468. The changes are merged to dev for testing.

We should keep this issue open until also fixing this one: https://github.com/geneontology/minerva/blob/7a068ed41dc9a95652e25cba73c60ead9a214e23/minerva-core/src/main/java/org/geneontology/minerva/json/MolecularModelJsonRenderer.java#L226-L232

kltm commented 2 years ago

@balhoff Pulled and cycled on noctua-dev for testing.

balhoff commented 2 years ago

A follow up PR #473 with some additional performance gains has been merged into dev for testing.

balhoff commented 2 years ago

@vanaukenk this latest performance improvement is deployed for testing on noctua-dev. It affects how relation labels are found in Minerva, so please note any oddities there. The big models like http://noctua-dev.berkeleybop.org/editor/graph/gomodel:5b318d0900000194 should load much more quickly as well.

vanaukenk commented 2 years ago

Here are some Noctua graph approximate loading time stats on my machine today:

Gluconeogenesis imported from Reactome.

Ctnnb1 (MGI:MGI:88276)

Wnt3a (MGI:MGI:98956)

C. elegans IRE-1 mediated unfolded protein response

Noctua-prod is generally faster, but I don't know if this constitutes 'much more quickly'.

I haven't seen any issues with how labels are being displayed.

vanaukenk commented 2 years ago

With help from @tmushayahama , we also tested and checked the Fetch/XHR times and see an approximately 50% reduction in the form editor table for loading mouse Ctnnb1 on dev (3.07s) vs prod (8.76s). Prod seems even faster than before, but there is still a noticeable decrease on dev.

kltm commented 2 years ago

@vanaukenk Shall I take this to be a pass for this PR, with it going to production on next cycle?

vanaukenk commented 2 years ago

@kltm - yes, we can't find anything systematically out of order. Thx.

balhoff commented 2 years ago

@vanaukenk your measurements are very different from what I see here. Maybe we should look at this live next time we meet. For me Ctnnb1 (MGI:MGI:88276) (http://noctua.geneontology.org/editor/graph/gomodel:6205c24300000538) loads in a few seconds, most of which is client-side I think.

vanaukenk commented 2 years ago

@balhoff yes, we could look at this together some time. Are you looking at the graph or form?

Also, with @tmushayahama we were looking at the loading times as recorded in the browser, while when I was testing this myself, it was just crudely counting.

balhoff commented 2 years ago

I was looking at the graph. My PR was optimizing one specific loading time for the initial m3Batch, which Tremayne was probably looking at, but also just overall the page loads in a few seconds for me.