Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 22:45
    eolivelli commented #4914
  • Jan 31 2019 22:07
    samsartor starred google/flatbuffers
  • Jan 31 2019 21:28
    marang starred google/flatbuffers
  • Jan 31 2019 20:51
    thyrlian starred google/flatbuffers
  • Jan 31 2019 19:19
    harshshah903 commented #5144
  • Jan 31 2019 19:19
    harshshah903 commented #5144
  • Jan 31 2019 18:56
    aardappel commented #4914
  • Jan 31 2019 18:54
    aardappel commented #5144
  • Jan 31 2019 18:51
    aardappel commented #5141
  • Jan 31 2019 18:51
    aardappel commented #5145
  • Jan 31 2019 18:51
    krojew commented #5142
  • Jan 31 2019 18:49
    krojew commented #5142
  • Jan 31 2019 18:48
    gabyx edited #5142
  • Jan 31 2019 18:48
    gabyx edited #5142
  • Jan 31 2019 18:47
    gabyx commented #5142
  • Jan 31 2019 18:47
    aardappel commented #5002
  • Jan 31 2019 18:43
    gabyx commented #5142
  • Jan 31 2019 18:43
    krojew commented #5142
  • Jan 31 2019 18:43
    aardappel commented #5143
  • Jan 31 2019 18:42
    gabyx commented #5142
Wouter van Oortmerssen
@aardappel
or if you could serialize each object in its own (size prefixed) buffer, and write a list of those to your file.. but that likely takes more space
Gopi M Tatiraju
@heisenbuug
Both functions look like this, just different values
  auto pName = builder.CreateString("BiasdasdgFoot");
  auto pAge = 91;
  auto pWeight = 123.5;

  auto Person = CreatePerson(builder, pName, pAge, pWeight, Gender_Male);

  // builder.FinishSizePrefixed(Person);
  builder.Finish(Person);
Wouter van Oortmerssen
@aardappel
yes, like I said, you must not have asserts on, because the second time you call Finish you should get an error
Gopi M Tatiraju
@heisenbuug
Oh...
But then how can we create multiple Person without using vector?
Can't I just keep creating Person and keep appending to the file?
Maybe I am not able to explain my use case properly.
What I understood is, we can only use Finish once.
In my code I am not getting any errors because asserts are off.
Wouter van Oortmerssen
@aardappel
again, you can't do it using vector
please read what I typed above again
and turn asserts on
Gopi M Tatiraju
@heisenbuug
How to turn on asserts?
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG
Building like this will turn on asserts?
Wouter van Oortmerssen
@aardappel
it should, yes
Gopi M Tatiraju
@heisenbuug
Thank you.
Now I am clearing the buffer using builder.Clear() and reusing it.
Gopi M Tatiraju
@heisenbuug
@aardappel Thank you soo much. It worked. And since this time assets were turned on and I got no errors, I am assuming I did everything right.
Although I need to explore more to understand things better, I am off to a good start. I might even try contributing to the project.
Wouter van Oortmerssen
@aardappel
cool :)
hustqy
@hustqy
guys, i need to use flatbuffer with grpc , when i use flatc --grpc --cpp ./greeter.fbs in /grpc/samples/greeters, only 3 files added, greeter_generated.grpc.fb.cc greeter_generated.grpc.fb.h greeter_generated.h, and file greeter.grpc.fb.h not found which is used in server.cpp . any one can help ?
Wouter van Oortmerssen
@aardappel
@hustqy thanks for reporting, looks like that was broken by the recent PR google/flatbuffers#6954
for now you may have to rename them manually to make it build, or fix the code/Makefile
kai
@kai:nasnotfound.de
[m]
I like the FlatBuffers IDL and want to use it with a custom wire format. I figured, using the intermediate representation is a good start. Is there a way to use some code generation infrastructure from flatc for this use case, maybe by writing a plugin for it?
Wouter van Oortmerssen
@aardappel
@kai:nasnotfound.de you're in luck, flatc is able to write out a binary version of a parsed schema.. using FlatBuffers itself! This data is perfect for writing external code generators. You can easily read this data in any language that FlatBuffers already supports. The option is --bfbs I believe, and the schema for the data is in reflection/ .. see also some github issues where we talk more about using this for external code generators @dbaileychess
Bodie
@bsolomon-bw
has anyone compared the parsing performance of simdjson to flatbuffers' JSON parser? I'd love to see that added to the performance breakdown on the landing page
MikkelFJ
@mikkelfj
@bodie I'm the author of flatcc, the C implementation of FlatBuffers. This tool generates code for schema specific JSON parsers, and are rather fast compared to most JSON parser, and faster than flatc's JSON parser that dynamically looks up in the schema, but does not require code generation and compilation. I have not made a direct comparison to simdjson, and I am not sure if I recall correctly, but if it is based on technology covered in the blog by Daniel Lemire, then this is legit very fast. There are some tradeoffs where a schema can make things faster than a normal JSON parser, but also some SIMD techniques that are not feasible in a parser like flatcc JSON where it must build a valid buffer and do certain validation checks. There are some benchmark numbers based on a now rather old 2014 core i7 macbook pro 2.2Ghz machine on the flatcc site. Also, I'm not sure how simd parsing works with things now running more on more on ARM, although it should be possible to also do interesting stuff on that platform.