-
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
Feature/protobuf output #1273
Feature/protobuf output #1273
Conversation
Windows is rather developer unfriendly. Fixing the Protobuf issues is not straight-forward. I fear we have to bundle protoc.exe with the dependencies and point to it manually. cc: @alex85k |
@DennisOSRM : The newer dependencies you published at http://build.project-osrm.org/libs_osrm_Release_test.7z already have protoc.exe for protobuf 2.6. Building it from source would be really slow... |
bc04015
to
3b70649
Compare
rebased onto develop branch after merge of the osmium parsing. Nearing completion here, too. |
Newest protoc.exe is already in dependencies (together with protobuf v2.6.1), current path to it on appveyor is |
Rebased on develop and push to my fork: |
3b70649
to
94b780a
Compare
rebased onto develop. Now that the common interface between libOSRM and the rest of the stack is a |
Note to self: There's a hacky solution that doesn't break interface too much.
|
Windows compile works fine now. Thanks @alex85k for providing protoc binaries. |
@emiltin how hard is it to parse protobuffer encoded responses in cucumber tests? |
Haven't tried it, but I guess it shouldn't be too hard. There are of course Ruby bindings for protobuf https://code.google.com/p/ruby-protobuf. Someone is also maintaining RSpec matchers that can be used with cucumber: https://github.com/connamara/protobuf_spec. |
@emiltin thanks sounds easy enough. What do you think about checking the JSON as well the protobuffer encoded response with each query run during tests. |
I think it would be better to have a set of tests that specifically exercise the protobuf response format, and have the rest of the tests use only JOSN (or protobuffer if that's faster, which I doubt). |
yeah, that probably suffices. |
d329456
to
94be790
Compare
basic implementation is more or less done. Now it's time to get this through the last lap, i.e. add tests and verify the implementation is complete. |
what's the benefit of protobuf output - smaller size? |
@emiltin Deserialization should also be faster. Should be interesting for people who use libOSRM and compute a lot of queries/minute. |
i'm looking into adding tests for pbf output, but i'm getting empty outputs:
it also seems odd that the filename includes ".json"? |
@emiltin the code path is probably not correctly wired. I'll get to that Monday. |
if you're using osrm as a lib, can you use the basic c++ structures as response format, ie bypass pbf/json? |
The lib interface is called JSON container. It's an abstract data structure that behaves very similar to what JSON feels like. |
ok. just wondering why you would want to use pbf if you use osrm as a lib. wouldn't the encoding/decoding be unnecessary? |
yes, and no. You are right that it doesn't make too much sense when you use the lib. The use case is when you don't use the lib, but run requests over http. |
Ah we now expose the json container in the library interface as well? For some reason I thought it was still http::Reply there. Cool. |
First benchmarks have come in. The numbers should be taken with a bit of caution but they indicate good file sizes:
The numbers are relative to the respective JSON size. What we see is that the uncompressed protocol buffer encoded outputs are smaller and compress a little worse. This is expected and the overall compressed file size is still smaller by a good margin. @emiltin 0384c21 should have proper output. Please note that it is binary encoded data and that it may appear as empty when printing to the console. |
do you mean the compressed json is smaller (0.46) than both raw pbf (0.72) and compresed pbf (0.66)? |
…all" This reverts commit 1e0366d. Conflicts: plugins/nearest.hpp
a586346
to
a384955
Compare
did you regenerate the .pp.rb file? |
Right, regenerated but there were no significant differences to the existing one. |
the protobuffer documenation (google, not the gem) states: Groups so either the protobuffer definition uses these deprecated, or is somehow intepreted wrong? |
response.pb.cc includes references to WIRETYPE_END_GROUP, which is causing exceptions at https://github.com/localshred/protobuf/blob/a5e6efcca4a8ac79bc21566411b3faeed8a07804/lib/protobuf/decoder.rb#L28. could it be osmium using pbf groups? |
Dropping this PR because it only increases the surface of code to maintain. We should support JSON output only for simplicity and maintainability. If you are worried about data size of the response consider using |
Adds a protobuf descriptor and supersedes #1161.
TODO: