zoukankan      html  css  js  c++  java
  • Protocol Buffers中的optimize_for选项

    http://code.google.com/apis/protocolbuffers/docs/proto.html#options

    • optimize_for (file option): Can be set to SPEED, CODE_SIZE, or LITE_RUNTIME. This affects the C++ and Java code generators (and possibly third-party generators) in the following ways:
      • SPEED (default): The protocol buffer compiler will generate code for serializing, parsing, and performing other common operations on your message types. This code is extremely highly optimized.
      • CODE_SIZE: The protocol buffer compiler will generate minimal classes and will rely on shared, reflection-based code to implement serialialization, parsing, and various other operations. The generated code will thus be much smaller than with SPEED, but operations will be slower. Classes will still implement exactly the same public API as they do in SPEED mode. This mode is most useful in apps that contain a very large number .proto files and do not need all of them to be blindingly fast.
      • LITE_RUNTIME: The protocol buffer compiler will generate classes that depend only on the "lite" runtime library (libprotobuf-lite instead of libprotobuf). The lite runtime is much smaller than the full library (around an order of magnitude smaller) but omits certain features like descriptors and reflection. This is particularly useful for apps running on constrained platforms like mobile phones. The compiler will still generate fast implementations of all methods as it does in SPEED mode. Generated classes will only implement the MessageLite interface in each language, which provides only a subset of the methods of the full Message interface.
      option optimize_for = CODE_SIZE;


  • 相关阅读:
    SSH公/私秘钥的生成及使用
    使用docker-compose部署Kafka集群
    使用docker或者docker-compose部署Zookeeper集群
    zookeeper相关概念
    redis相关概念
    mq-rabbitmq
    mysql事务隔离级别
    新自动化测试框架+微信机器人构建思路
    当eclipse调用tomcat的时候发生了什么?
    .net 获取配置项
  • 原文地址:https://www.cnblogs.com/androidme/p/2394697.html
Copyright © 2011-2022 走看看