Skip to content

Conversation

@ross-spencer
Copy link
Collaborator

@ross-spencer ross-spencer commented Sep 18, 2025

Parseable was using a pattern whereby a listing function was called in nested loops. Removing this function call and replacing it with a single assignment to a variable increases performance of these functions by ~10x (clock time).

May have a positive impact on #148


NB. just using the timing options available, i.e. unit test time, and wall clock. Siegfried unit tests are included as a convenience as they call some of the same signature init functions, it is expected this change will only impact roy.

Results

Roy unit tests

Before

ross-spencer@exponential-decay:/tmp/sf/siegfried/cmd/roy$ go test
PASS
ok  	github.com/richardlehane/siegfried/cmd/roy	89.432s

After

ross-spencer@exponential-decay:/tmp/sf/siegfried/cmd/roy$ go test
PASS
ok  	github.com/richardlehane/siegfried/cmd/roy	9.342s

SF unit tests

Before

ross-spencer@exponential-decay:/tmp/sf/siegfried/cmd/sf$ go test
PASS
ok  	github.com/richardlehane/siegfried/cmd/sf	7.616s

After

ross-spencer@exponential-decay:/tmp/sf/siegfried/cmd/sf$ go test
PASS
ok  	github.com/richardlehane/siegfried/cmd/sf	3.856s

Extend signature

Before

ross-spencer@exponential-decay:/tmp/sf/siegfried/cmd/roy$ time ./roy build -extend <sigfile.xml>

real	0m6.493s
user	0m7.324s
sys	0m0.086s

After

ross-spencer@exponential-decay:/tmp/sf/siegfried/cmd/roy$ time ./roy build -extend <sigfile.xml>

real	0m0.284s
user	0m0.939s
sys	0m0.076s

Parseable was using a pattern whereby a listing function was called
in nested loops. Removing this function call and replacing it with
a single assignment to a variable increases performance of these
functions by ~10x (clock time).
Copy link
Owner

@richardlehane richardlehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brilliant pickup! This looks good

@richardlehane richardlehane merged commit e8cc494 into develop Sep 18, 2025
24 checks passed
@richardlehane
Copy link
Owner

thanks @ross-spencer this is awesome
SoExcited~GIF

@ross-spencer ross-spencer mentioned this pull request Jan 1, 2026
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.

3 participants