Protobuf compiler yog dab tsi?
Protobuf compiler yog dab tsi?

Video: Protobuf compiler yog dab tsi?

Video: Protobuf compiler yog dab tsi?
Video: Building a messaging platform with GRPC and Protobuf - Guven Iscan and Claus Jorgensen 2024, Kaum ib hlis
Anonim

Kev Cai Buffers (a.k.a., ib. ua protobuf ) yog Google cov lus-nruab nrab, platform-nruab nrab, txuas ntxiv mechanism rau serializing cov ntaub ntawv tsim qauv. Rau nruab ua protobuf , koj yuav tsum tau nruab cov txheej txheem compiler (siv rau sau ua ke . proto cov ntaub ntawv) thiab cov ua protobuf runtime rau koj xaiv hom lus programming.

Kuj paub, dab tsi yog protoc compiler?

protoc yog a compiler rau raws tu qauv buffers txhais cov ntaub ntawv. Nws tuaj yeem tsim C ++, Java thiab Python qhov chaws rau cov chav kawm uas tau teev tseg hauv PROTO_FILE.

Tsis tas li ntawd, Google Protobuf ua haujlwm li cas? Protobuf yog ib cov ntaub ntawv serializing raws tu qauv zoo li JSON lossis XML. Koj txhais tau li cas koj xav kom koj cov ntaub ntawv raug teeb tsa ib zaug, ces koj ua tau siv cov cai tshwj xeeb tsim los kom yooj yim sau thiab nyeem koj cov ntaub ntawv tsim los thiab los ntawm ntau cov ntaub ntawv ntws thiab siv ntau hom lus.

Yog li ntawd, Protobuf siv rau dab tsi?

Kev Cai Buffers ( Protobuf ) yog ib txoj hauv kev serializing cov ntaub ntawv tsim. Nws yog ib qho tseem ceeb hauv kev tsim cov kev pab cuam los sib txuas lus nrog ib leeg dhau ib lub xaim lossis khaws cov ntaub ntawv. Cov qauv ntaub ntawv (hu ua lus) thiab cov kev pabcuam tau piav qhia hauv cov ntaub ntawv txhais lus proto (.proto) thiab muab tso ua ke nrog protoc.

Puas yog Protobuf sai dua JSON?

Protobuf yog ca3x sai dua Jackson thiab 1.33x sai dua DSL- JSON rau integer encoding. Protobuf tsis tseem ceeb sai dua ntawm no. Qhov optimization siv los ntawm DSL- JSON nyob ntawm no.

Pom zoo: