blmayer / ereandel

A Gemini web browser using shell script
gemini://terminal.pink/
MIT License
56 stars 6 forks source link

trace and first step in performance #44

Closed rnwgnr closed 1 year ago

rnwgnr commented 1 year ago

This PR adds a simple function to trace the time spend in code sections. It can be enabled by setting trace=1 when launching astro and will create a trace file in astro's cache dir.

Additionally the rendering of links has been modified to remove character replacement via sed which improves performance of link rendering a lot.

blmayer commented 1 year ago

Cool. One question: Does adding this code decreases performance even with trace=""?

I'm thinking in creating a test version of the astro file with all the debugging stuff, so the main file is much cleaner. What do you think?

blmayer commented 1 year ago

But that could be done in another time If don't want to change this PR.

rnwgnr commented 1 year ago

Does adding this code decreases performance even with trace=""

The difference may be measurable but for sure not something that has a remarkable impact of the overall performance. We essentially have an additional function call and a check, pretty much the same we have for the "debug" calls. This would add fractions of milliseconds.

blmayer commented 1 year ago

All right. Thanks for working on this.

rnwgnr commented 1 year ago

The change introduces issues on some capsules when interpreting link lines. I will look into it and try to fix this.