Skip to content

Optimise generated module to avoid calling external functions#67

Closed
hauleth wants to merge 1 commit intorkallos:mainfrom
hauleth:push-wznzwwurukrn
Closed

Optimise generated module to avoid calling external functions#67
hauleth wants to merge 1 commit intorkallos:mainfrom
hauleth:push-wznzwwurukrn

Conversation

@hauleth
Copy link
Copy Markdown
Contributor

@hauleth hauleth commented Feb 24, 2026

This reduces need for (relatively) expensive Map.take/2 and
Map.merge/2 calls if these aren't needed. It also traverses metric
list with internally defined function to avoid lambda and external
function call.

This reduces need for (relatively) expensive `Map.take/2` and
`Map.merge/2` calls if these aren't needed. It also traverses metric
list with internally defined function to avoid lambda and external
function call.
@rkallos
Copy link
Copy Markdown
Owner

rkallos commented Feb 24, 2026

You're on a roll!

I think our discussion in #66 suggests removing the adding of global tags to metrics altogether from the hot path, and adding them during scrape/UDP send instead. Perhaps inside or just after Peep.Storage.get_all_metrics/* (inside may avoid a traversal, but puts the responsibility of adding global tags on implementers of the Peep.Storage behaviour)

@hauleth
Copy link
Copy Markdown
Contributor Author

hauleth commented Feb 24, 2026

I have PR for that as well. It is just queued to be published. I spent last days on optimising the crap of Peep and Telemetry.

@rkallos
Copy link
Copy Markdown
Owner

rkallos commented Feb 24, 2026 via email

@hauleth
Copy link
Copy Markdown
Contributor Author

hauleth commented Feb 24, 2026

@rkallos I managed to parallelise it at #69

@hauleth
Copy link
Copy Markdown
Contributor Author

hauleth commented Feb 24, 2026

I even think that #69 make this PR irrelevant so maybe close it in favour of that?

@rkallos
Copy link
Copy Markdown
Owner

rkallos commented Feb 25, 2026

Closing now that #69 is merged.

@rkallos rkallos closed this Feb 25, 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.

2 participants