Skip to content
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 of interference-bump #96

Closed
wants to merge 15 commits into from

Conversation

xiota
Copy link
Contributor

@xiota xiota commented Nov 2, 2023

More verbose, but 21-25x speed-up.

Test scripts: bump_old.sh, bump_new.sh

$ time ./bump_old.sh acidrip zrythm zulucrypt

cmd: ./bump_old.sh acidrip zrythm zulucrypt
cpu: 100%
mem: 57
usr: 18.319
sys: 6.261
tot: 24.382

$ time ./bump_new.sh acidrip zrythm zulucrypt

cmd: ./bump_new.sh acidrip zrythm zulucrypt
cpu: 104%
mem: 56
usr: 0.851
sys: 0.178
tot: 0.983

Performance note: Original function was O(n^2) because it has nested n-loops. Revised function is O(n log n) because of use of sort. If not for sort, it would be O(n) because the outer loops are over small lists, O(1). Expected performance should be close to O(n) because package lists should be already sorted. It looks more inefficient because of repeated O(1) and O(n) blocks. But they combine to O(n).

Behavior change. Instead of printing entire PKGREL_BUMPS file, prints only bumped packages that haven't been rebuilt yet (without version info) because they are probably broken. Current output:

mate-panel-genmon-git
meshlab
meshlab-git
multimc5
mutter-performance
obs-streamfx
pixelorama-git
python-pympv
qucs
servo-git
vim-coc-sh-git
vscodium-electron

@dr460nf1r3
Copy link
Member

A major improvement 🚀

@xiota
Copy link
Contributor Author

xiota commented Nov 2, 2023

CI is failing because of shellcheck, but when I run it locally, it doesn't complain about anything.

@dr460nf1r3
Copy link
Member

dr460nf1r3 commented Nov 2, 2023

The logs state that prettier isn't happy 🤓

@xiota
Copy link
Contributor Author

xiota commented Nov 2, 2023

Prettier is not happy because it doesn't have files to process?

$ prettier . && shellcheck *
[error] No supported files were found in the directory: ".".

$ if prettier . ; then echo true ; else echo false ; fi
[error] No supported files were found in the directory: ".".
false

$ if shellcheck * ; then echo true ; else echo false ; fi
true

@dr460nf1r3
Copy link
Member

dr460nf1r3 commented Nov 2, 2023

I think you might be missing the shell plugin, iirc Arch had several packages for this purpose.

https://www.npmjs.com/package/prettier-plugin-sh

https://github.com/chaotic-aur/toolbox/blob/main/package.json#L5

For reference see the #lint section of the toolboxes' README 😁

@xiota
Copy link
Contributor Author

xiota commented Nov 2, 2023

Still can't find what's wrong.

$ yarn run lint
yarn run v1.22.19
$ prettier --check . && shellcheck src/*.sh src/lib/*.sh guest/bin/* slurm-jobs/*/*.sh
Checking formatting...
All matched files use Prettier code style!
Done in 3.28s.

@dr460nf1r3
Copy link
Member

I will be taking a look as soon as possible.

@xiota
Copy link
Contributor Author

xiota commented Nov 2, 2023

Got it... yarn prettify took care of it.

@xiota
Copy link
Contributor Author

xiota commented Nov 14, 2023

This doesn't work with split packages. Did the original?

@dr460nf1r3
Copy link
Member

This doesn't work with split packages. Did the original?

Afaik it did not, and pkgbase also did not 👀

@xiota
Copy link
Contributor Author

xiota commented Nov 14, 2023

This doesn't work with split packages. Did the original?

Afaik it did not, and pkgbase also did not 👀

Will think about how/if-possible to add it. Would be easier if some way to track them.

@xiota xiota marked this pull request as draft December 20, 2023 05:32
@xiota xiota closed this Jan 26, 2024
@xiota xiota deleted the pr_interfere branch January 26, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants