- Go 81.6%
- go-html-template 10.4%
- TypeScript 2.7%
- JavaScript 2.1%
- CSS 1.8%
- Other 1.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
## Background - This command executes in 50ms-300ms on https://codeberg.org/forgejo/forgejo/actions - Codeberg has for every repository its references stored in reftable (https://git-scm.com/docs/reftable). - The forgejo repository has 13019 references. - All git data is stored on CephFS. ## Changes From my understanding of git's source-code, `for-each-ref` is able to iteratively go over refs (and stop after the first reference found). While `rev-list` is more feature-rich and goes through more hoops than just 'iterate over refs'. - Use `git-for-each-ref(1)` to detect if there's any reference. - Specify a custom format to avoid loading object storage. Mostly a nice-to-have as it avoids a few `access` syscalls to object storage, we don't need that information for this function. ## Benchmarks Codeberg (CephFS): ``` $ hyperfine -N 'git for-each-ref --count=1 --format=found' 'git for-each-ref --count=1' 'git rev-list -n 1 --all' Benchmark 1: git for-each-ref --count=1 --format=found Time (mean ± σ): 12.3 ms ± 10.5 ms [User: 3.2 ms, System: 3.0 ms] Range (min … max): 4.6 ms … 78.0 ms 142 runs Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. Benchmark 2: git for-each-ref --count=1 Time (mean ± σ): 23.2 ms ± 16.5 ms [User: 3.6 ms, System: 4.1 ms] Range (min … max): 7.9 ms … 87.6 ms 186 runs Benchmark 3: git rev-list -n 1 --all Time (mean ± σ): 199.4 ms ± 75.4 ms [User: 67.5 ms, System: 25.9 ms] Range (min … max): 134.4 ms … 438.2 ms 16 runs Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. Summary git for-each-ref --count=1 --format=found ran 1.89 ± 2.10 times faster than git for-each-ref --count=1 16.24 ± 15.19 times faster than git rev-list -n 1 --all ``` Locally, same amount of refs (ext4): ``` $ hyperfine -N 'git for-each-ref --count=1 --format=found' 'git for-each-ref --count=1' 'git rev-list -n 1 --all' Benchmark 1: git for-each-ref --count=1 --format=found (2155 runs) mean ± σ min … max Wall Time 1.1 ms ± 0.1 ms 1.0 ms … 1.7 ms Memory 6.6 MiB ± 0.1 MiB 6.2 MiB … 7.0 MiB Benchmark 2: git for-each-ref --count=1 (2713 runs) mean ± σ min … max Wall Time 1.1 ms ± 0.1 ms 1.0 ms … 1.8 ms +4.2% Memory 6.8 MiB ± 0.1 MiB 6.3 MiB … 7.1 MiB +2.5% Benchmark 3: git rev-list -n 1 --all (591 runs) mean ± σ min … max Wall Time 4.8 ms ± 0.3 ms 4.3 ms … 6.6 ms +339.3% (4.4x slower) Memory 8.7 MiB ± 0.1 MiB 8.2 MiB … 8.9 MiB +30.9% (1.3x more) ``` Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/14809 Reviewed-by: Andreas Ahlenstorf <[email protected]> Reviewed-by: famfo-cb <[email protected]> |
||
| .devcontainer | ||
| .forgejo | ||
| .semgrep | ||
| assets | ||
| build | ||
| cmd | ||
| contrib | ||
| custom/conf | ||
| docker | ||
| models | ||
| modules | ||
| options | ||
| public | ||
| release-notes | ||
| release-notes-published | ||
| releases/images | ||
| routers | ||
| services | ||
| templates | ||
| tests | ||
| tools | ||
| web_src | ||
| .air.toml | ||
| .deadcode-out | ||
| .dockerignore | ||
| .editorconfig | ||
| .envrc.example | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| .gitpod.yml | ||
| .golangci.yml | ||
| .ignore | ||
| .mailmap | ||
| .markdownlint.yaml | ||
| .mockery.yml | ||
| .node-version | ||
| .npmrc | ||
| .release-notes-assistant.yaml | ||
| .spectral.yaml | ||
| .yamllint.yaml | ||
| BSDmakefile | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| DCO | ||
| Dockerfile | ||
| Dockerfile.rootless | ||
| eslint.config.ts | ||
| flake.lock | ||
| flake.nix | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| Makefile | ||
| manifest.scm | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| release-notes-assistant.sh | ||
| RELEASE-NOTES.md | ||
| shell.nix | ||
| stylelint.config.ts | ||
| tailwind.config.ts | ||
| tsconfig.json | ||
| vitest.config.ts | ||
| webpack.config.ts | ||
Welcome to Forgejo
Hi there! Tired of big platforms playing monopoly? Providing Git hosting for your project, friends, company or community? Forgejo (/for'd͡ʒe.jo/ inspired by forĝejo – the Esperanto word for forge) has you covered with its intuitive interface, light and easy hosting and a lot of built-in functionality.
Forgejo was created in 2022 because we think that the project should be owned by an independent community. If you second that, then Forgejo is for you! Our promise: Independent Free/Libre Software forever!
What does Forgejo offer?
If you like any of the following, Forgejo is literally meant for you:
- Lightweight: Forgejo can easily be hosted on nearly every machine. Running on a Raspberry? Small cloud instance? No problem!
- Project management: Besides Git hosting, Forgejo offers issues, pull requests, wikis, kanban boards and much more to coordinate with your team.
- Publishing: Have something to share? Use releases to host your software for download, or use the package registry to publish it for docker, npm and many other package managers.
- Customizable: Want to change your look? Change some settings? There are many config switches to make Forgejo work exactly like you want.
- Powerful: Organizations & team permissions, CI integration, Code Search, LDAP, OAuth and much more. If you have advanced needs, Forgejo has you covered.
- Privacy: From update checker to default settings: Forgejo is built to be privacy first for you and your crew.
- Federation: (WIP) We are actively working to connect software forges with each other through ActivityPub, and create a collaborative network of personal instances.
Learn more
Dive into the documentation, subscribe to releases and blog post on our website, find us on the Fediverse or hop into our Matrix room if you have any questions or want to get involved.
License
Forgejo is distributed under the terms of the GPL version 3.0 or any later version.
The agreement for this license was documented in June 2023 and implemented during the development of Forgejo v9.0. All Forgejo versions before v9.0 are distributed under the MIT license.
Get involved
If you are interested in making Forgejo better, either by reporting a bug or by changing the governance, please take a look at the contribution guide.