-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Improve performance of JSON rendering #6380
Merged
Merged
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
463663b
wip
SiarheiFedartsou a9c72e3
Refactor json renderer to share implementation for vector and string
SiarheiFedartsou cb0af6b
Add string
SiarheiFedartsou 4b0ea28
Merge branch 'master' into sf-json-perf
SiarheiFedartsou c784ff7
Optimize strings
SiarheiFedartsou b9957bb
Get rid of copy
SiarheiFedartsou 3781068
add check
SiarheiFedartsou 666ff1c
use std::string in node bindings
SiarheiFedartsou d2ce6d2
add comments
SiarheiFedartsou ca7e560
fix bug
SiarheiFedartsou 05c6008
add comments
SiarheiFedartsou 4f222be
add comments
SiarheiFedartsou 889e4ce
add comments
SiarheiFedartsou 87db480
add comments
SiarheiFedartsou 258d656
fix bug
SiarheiFedartsou a4d1783
use fmt
SiarheiFedartsou ee7499d
use fmt
SiarheiFedartsou d033e3b
use fmt
SiarheiFedartsou d871e20
use fmt
SiarheiFedartsou bc6a4d8
add test
SiarheiFedartsou ae157de
add test
SiarheiFedartsou 6a5b3f4
add test
SiarheiFedartsou 50efe45
update changelog
SiarheiFedartsou 04429d4
update
SiarheiFedartsou 7430d62
optimize nodejs
SiarheiFedartsou 03f9671
update
SiarheiFedartsou 32deb11
update benchmark
SiarheiFedartsou cbc0868
update benchmark
SiarheiFedartsou f057ef7
update benchmark
SiarheiFedartsou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,4 +115,4 @@ Feature: Annotations | |
|
||
When I route I should get | ||
| from | to | route | a:speed | a:distance | a:duration | a:nodes | | ||
| a | c | abc,abc | 10:10 | 249.987619:299.962882 | 25:30 | 1:2:3 | | ||
| a | c | abc,abc | 10:10 | 249.987618946:299.962882039 | 25:30 | 1:2:3 | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems to be expected since we changed algorithm used for formatting. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,8 +60,8 @@ struct V8Renderer | |
|
||
inline void renderToV8(v8::Local<v8::Value> &out, const osrm::json::Object &object) | ||
{ | ||
osrm::json::Value value = object; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This copy is expensive... |
||
mapbox::util::apply_visitor(V8Renderer(out), value); | ||
V8Renderer renderer(out); | ||
renderer(object); | ||
} | ||
} // namespace node_osrm | ||
|
||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.
Baseline on my M1 Pro/32 gb ram:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"string" here is
std::stringstream ss; ... = ss.str()