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

Fix quadric memcpy on toJson #259

Merged
merged 2 commits into from
Sep 15, 2024
Merged

Fix quadric memcpy on toJson #259

merged 2 commits into from
Sep 15, 2024

Conversation

ydot13
Copy link
Contributor

@ydot13 ydot13 commented Sep 12, 2024

accumulate cpy full string on each char, I replaced it with std::string::push_back/append, now its complexity is amortized linear

@ydot13 ydot13 changed the title Fix quadric memcpy and allocation on toJson Fix quadric memcpy on toJson Sep 12, 2024
@ydot13
Copy link
Contributor Author

ydot13 commented Sep 12, 2024

@rmorozov please, have a look.

robot-piglet pushed a commit to yandex/yatool that referenced this pull request Sep 13, 2024
@rmorozov
Copy link
Member

@ydot13 , seems ok

in c++20 std::accumulate defaults to std::move for init so complexity will definitely be not as bad

but let it be in your way

@rmorozov rmorozov merged commit e98b3b5 into jinja2cpp:master Sep 15, 2024
99 checks passed
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