Skip to content

Conversation

paultranvan
Copy link
Contributor

We had 3 different queries to do the same thing: query a io.cozy.files by its id.
Typically for a directory abc, we had 3 queries named:

  • io.cozy.files/abc
  • onlyfolder-abc
  • folder-abc

The only specialization was for the folder-abc that was including parent and encryption, but it does not seem used anymore.

This is useless and hurt performances: as we duplicate such queries, they are kept in the store and reevaluated independently even though the id and the results are the same. It also takes memory for nothing. Thus, let's mutualize.

We had 3 different queries to do the same thing: query a io.cozy.files
by its id.
Typically for a directory `abc`, we had 3 queries named:
- `io.cozy.files/abc`
- `onlyfolder-abc`
- `folder-abc`

The only specialization was for the `folder-abc` that was including
`parent` and `encryption`, but it does not seem used anymore.

This is useless and hurt performances: as we duplicate such queries,
they are kept in the store and reevaluated independently even though the
id and the results are the same. It also takes memory for nothing.
Thus, let's mutualize.
Copy link

bundlemon bot commented Jul 9, 2025

BundleMon

Files updated (3)
Status Path Size Limits
static/js/main.(hash).js
117.12KB (-59B -0.05%) -
public/static/js/public.(hash).js
86.09KB (-63B -0.07%) -
public/static/js/cozy.(hash).js
711.47KB (-66B -0.01%) -
Unchanged files (18)
Status Path Size Limits
static/js/(chunkId).(hash).js
967.38KB -
public/static/js/(chunkId).(hash).js
872.3KB -
static/js/cozy.(hash).js
845.89KB -
(hash).js
337.62KB -
public/(hash).js
337.62KB -
services/qualificationMigration.js
282.6KB -
services/dacc.js
264.84KB -
public/static/js/lib-react.(hash).js
39.37KB -
static/js/lib-react.(hash).js
39.37KB -
public/static/css/cozy.(hash).css
33.69KB -
static/css/cozy.(hash).css
33.69KB -
public/static/js/lib-router.(hash).js
22.05KB -
static/js/lib-router.(hash).js
22.05KB -
static/css/main.(hash).css
16.2KB -
public/static/css/public.(hash).css
5.89KB -
manifest.webapp
1.89KB -
index.html
689B -
assets/manifest.json
185B -

Total files change -193B 0%

Groups updated (1)
Status Path Size Limits
**/*.js
6.45MB (-196B 0%) -
Unchanged groups (2)
Status Path Size Limits
**/*.{png,svg,ico}
2.15MB -
**/*.css
128.49KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@paultranvan paultranvan merged commit 3e39ee0 into master Jul 10, 2025
4 checks passed
@paultranvan paultranvan deleted the mutualize-queryid branch July 10, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants