Skip to content

Perform file tokenization in python - #437

Open
WhatAmISupposedToPutHere wants to merge 1 commit into
bootlin:masterfrom
WhatAmISupposedToPutHere:update-faster
Open

Perform file tokenization in python#437
WhatAmISupposedToPutHere wants to merge 1 commit into
bootlin:masterfrom
WhatAmISupposedToPutHere:update-faster

Conversation

@WhatAmISupposedToPutHere

Copy link
Copy Markdown

Avoid going through bash and perl just to run some regexes. No existing project files override those functions, so no functionality is lost.

update.py speed comparison on a clean import of arm-trusted-firmware

before:
real 21m53.464s
user 49m20.962s
sys 30m0.147s

after:
real 21m5.273s
user 44m39.705s
sys 26m11.396s

@tleb

tleb commented Aug 21, 2026

Copy link
Copy Markdown
Member

Hi, yes I'm down for this. But it completely breaks file rendering. All files appear as a single empty line. Agreed?


Reproducer:

⟩ git checkout -q -f 9ae8062

⟩ # change musl repo because it's inaccessible and fetch a single tag
⟩ git diff -U0 utils/index
diff --git a/utils/index b/utils/index
index 3298a87..6f7f15f 100755
--- a/utils/index
+++ b/utils/index
@@ -47 +47 @@ project_fetch() {
-    $git fetch --all --tags -j4
+    $git fetch --no-tags remote0 +refs/tags/v1.2.6:refs/tags/v1.2.6
@@ -128 +128 @@ add_default_remotes $1 $# $2 mesa https://gitlab.freedesktop.org/mesa/mesa.git
-add_default_remotes $1 $# $2 musl https://git.musl-libc.org/git/musl
+add_default_remotes $1 $# $2 musl https://github.com/kraj/musl.git

⟩ docker build -q -t elixir-repro -f docker/Dockerfile .
⟩ sudo rm -rf data/

⟩ docker run --rm -v ./data:/srv/elixir-data --entrypoint index \
  elixir-repro /srv/elixir-data musl
... indexes v1.2.6 ...

⟩ docker run -d --name lxr-t -p 8080:80 -v ./data:/srv/elixir-data elixir-repro
⟩ curl -s http://localhost:8080/musl/v1.2.6/source/crt/crt1.c | grep -c 'codeline'
1

⟩ # => the whole file renders as one empty line; on master: 19 code lines,
⟩ # 8 ident links

Avoid going through bash and perl just to run some regexes. No existing
project files override those functions, so no functionality is lost.

update.py speed comparison on a clean import of arm-trusted-firmware

before:
real	21m53.464s
user	49m20.962s
sys	30m0.147s

after:
real	21m5.273s
user	44m39.705s
sys	26m11.396s

Signed-off-by: Sasha Finkelstein <k@chaosmail.tech>
@WhatAmISupposedToPutHere

Copy link
Copy Markdown
Author

Oops, sorry about that, it appears that i failed at rebasing this from my dev branch. Should render correctly now.

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