Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace usage of []byte with string in the renderer #619

Closed
xcoulon opened this issue Jun 16, 2020 · 1 comment
Closed

Replace usage of []byte with string in the renderer #619

xcoulon opened this issue Jun 16, 2020 · 1 comment

Comments

@xcoulon
Copy link
Member

xcoulon commented Jun 16, 2020

Using string builders instead of bytes buffer when executing the templates, and avoiding the | print "%s" in some templates afterwards, which is a wasting of memory since the data is copied when converted.

@gdamore
Copy link
Collaborator

gdamore commented Jun 20, 2020

This was bugging me enough (it makes reading and working with the templates kind of annoying), that I went ahead and did this. PR incoming.

@gdamore gdamore added this to the v0.5.0 milestone Jun 20, 2020
gdamore added a commit to gdamore/libasciidoc that referenced this issue Jun 20, 2020
This uses strings.Builder to get more efficiency and reduce
copies, but more importantly it gets rid of the need to pipe
output through printf "%s" in templates, which makes them
cleaner and nicer to work with.

Fixes bytesparadise#619
gdamore added a commit to gdamore/libasciidoc that referenced this issue Jun 20, 2020
This uses strings.Builder to get more efficiency and reduce
copies, but more importantly it gets rid of the need to pipe
output through printf "%s" in templates, which makes them
cleaner and nicer to work with.

Fixes bytesparadise#619
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants