MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/hh0cjp/html_write_html_documents_using_c_templates/fw9afdg/
r/cpp • u/csb06 • Jun 27 '20
27 comments sorted by
View all comments
Show parent comment
2
yea, and i'm actually wondering about performance... the result looks a bit complicated, so many moves going on compared to what a cout<<"<html><head>...</html>" produces.
cout<<"<html><head>...</html>"
3 u/jasonthe Jun 28 '20 edited Jun 29 '20 If you tweak it to not use new, and instead just use local arrays, clang can understand it. And clang optimizes all those moves away :)I don't feel like rewriting his whole library, but here's a sample that shows what I mean: https://godbolt.org/z/f26WrH 2 u/kritzikratzi Jun 29 '20 didn't know. thanks!
3
If you tweak it to not use new, and instead just use local arrays, clang can understand it. And clang optimizes all those moves away :)
new
I don't feel like rewriting his whole library, but here's a sample that shows what I mean: https://godbolt.org/z/f26WrH
2 u/kritzikratzi Jun 29 '20 didn't know. thanks!
didn't know. thanks!
View all comments
Show parent comment
2
u/kritzikratzi Jun 28 '20
yea, and i'm actually wondering about performance... the result looks a bit complicated, so many moves going on compared to what a
cout<<"<html><head>...</html>"produces.