summaryrefslogtreecommitdiff
path: root/issues/improve-menu-generation-and-move-it-to-gn3.gmi
blob: 23881c460604a6a236b354110238eea1c9bdda73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Improve Menu Generation and Move it to GN3

## Tags

* assigned: fredm
* type: bug
* priority: medium
* status: closed, completed
* keywords: menu generation, GN2, GN3

## Description

The
=> https://github.com/genenetwork/genenetwork2/blob/testing/wqflask/wqflask/api/gen_menu.py#L6-L17 gen_dropdown_json
function calls functions that make queries to the database within loops.

This ruins the performance of the system significantly.

The queries should be reworked, and the code should be moved to GN3 since it does database access.

### TODOs

* [ ] Rework the queries: don't run queries inside loops
* [x] Move the code to GN3
* [x] Provide results of function at an endpoint in GN3

## Update: 2022-05-26

Commits
=> https://github.com/genenetwork/genenetwork3/commit/236d9236c794d7870258eab9e087f990c557462a
=> https://github.com/genenetwork/genenetwork2/commit/e71d2c5d35771645a85a5e0fa7ebdfca4809a16b
=> https://github.com/genenetwork/genenetwork2/commit/98367087f262c0d0cdd7aae691989f90f4d40dcc
enable the fetching of the menu items from GN3. They also report in case of any errors fetching the data from the server.

There is still a need to remove the code from GN2 but it might be a while since it is seemingly used in more than one place.

## Update: 2022-06-23

Commits
=> https://github.com/genenetwork/genenetwork3/commit/236d9236c794d7870258eab9e087f990c557462a
=> https://github.com/genenetwork/genenetwork2/commit/98367087f262c0d0cdd7aae691989f90f4d40dcc
move the menu generation code to GN3, and have GN2 only handle the display.

I have also made changes to some of the functions to optimise the queries to the database.

The remaining functions have proved really difficult to detangle and optimise, so for now I will mark this issue as done, until such a time as the performance of the menu proves to be unnacceptably slow.