blob: ac42aa5a924cc43310c4bf3555a978aeeae74368 [file] [log] [blame]
Josh Haberman7d5cf8d2015-02-25 23:47:09 -080012015-02-26 version 3.0.0-alpha-2 (Python/Ruby/JavaNano):
Jisi Liu32f5d012015-02-20 14:45:45 -08002 General
Josh Haberman7d5cf8d2015-02-25 23:47:09 -08003 * Introduced three new language implementations (Ruby, JavaNano, and
4 Python) to proto3.
Jisi Liu32f5d012015-02-20 14:45:45 -08005 * Various bug fixes since 3.0.0-alpha-1
6
Josh Haberman31e8c202015-02-25 23:06:35 -08007 Python:
8 Python has received several updates, most notably support for proto3
9 semantics in any .proto file that declares syntax="proto3".
10 Messages declared in proto3 files no longer represent field presence
11 for scalar fields (number, enums, booleans, or strings). You can
12 no longer call HasField() for such fields, and they are serialized
13 based on whether they have a non-zero/empty/false value.
14
15 One other notable change is in the C++-accelerated implementation.
16 Descriptor objects (which describe the protobuf schema and allow
17 reflection over it) are no longer duplicated between the Python
18 and C++ layers. The Python descriptors are now simple wrappers
19 around the C++ descriptors. This change should significantly
20 reduce the memory usage of programs that use a lot of message
21 types.
22
Jisi Liu32f5d012015-02-20 14:45:45 -080023 Ruby:
Chris Fallin1d4f3212015-02-20 17:32:06 -080024 We have added proto3 support for Ruby via a native C extension.
25
26 The Ruby extension itself is included in the ruby/ directory, and details on
27 building and installing the extension are in ruby/README.md. The extension
28 will also be published as a Ruby gem. Code generator support is included as
29 part of `protoc` with the `--ruby_out` flag.
30
31 The Ruby extension implements a user-friendly DSL to define message types
32 (also generated by the code generator from `.proto` files). Once a message
33 type is defined, the user may create instances of the message that behave in
34 ways idiomatic to Ruby. For example:
35
36 - Message fields are present as ordinary Ruby properties (getter method
37 `foo` and setter method `foo=`).
38 - Repeated field elements are stored in a container that acts like a native
39 Ruby array, and map elements are stored in a container that acts like a
40 native Ruby hashmap.
41 - The usual well-known methods, such as `#to_s`, `#dup`, and the like, are
42 present.
43
44 Unlike several existing third-party Ruby extensions for protobuf, this
45 extension is built on a "strongly-typed" philosophy: message fields and
46 array/map containers will throw exceptions eagerly when values of the
47 incorrect type are inserted.
48
49 See ruby/README.md for details.
Jisi Liu32f5d012015-02-20 14:45:45 -080050
51 JavaNano:
52 JavaNano is a special code generator and runtime library designed especially
53 for resource-restricted systems, like Android. It is very resource-friendly
54 in both the amount of code and the runtime overhead. Here is an an overview
55 of JavaNano features compared with the official Java protobuf:
56
57 - No descriptors or message builders.
58 - All messages are mutable; fields are public Java fields.
59 - For optional fields only, encapsulation behind setter/getter/hazzer/
60 clearer functions is opt-in, which provide proper 'has' state support.
61 - For proto2, if not opted in, has state (field presence) is not available.
62 Serialization outputs all fields not equal to their defaults.
63 The behavior is consistent with proto3 semantics.
64 - Required fields (proto2 only) are always serialized.
65 - Enum constants are integers; protection against invalid values only
66 when parsing from the wire.
67 - Enum constants can be generated into container interfaces bearing
68 the enum's name (so the referencing code is in Java style).
69 - CodedInputByteBufferNano can only take byte[] (not InputStream).
70 - Similarly CodedOutputByteBufferNano can only write to byte[].
71 - Repeated fields are in arrays, not ArrayList or Vector. Null array
72 elements are allowed and silently ignored.
73 - Full support for serializing/deserializing repeated packed fields.
74 - Support extensions (in proto2).
75 - Unset messages/groups are null, not an immutable empty default
76 instance.
77 - toByteArray(...) and mergeFrom(...) are now static functions of
78 MessageNano.
79 - The 'bytes' type translates to the Java type byte[].
80
81 See javanano/README.txt for details.
82
Feng Xiao9104da32014-12-09 11:57:52 -0800832014-12-01 version 3.0.0-alpha-1 (C++/Java):
84
85 General
86 * Introduced Protocol Buffers language version 3 (aka proto3).
87
88 When protobuf was initially opensourced it implemented Protocol Buffers
89 language version 2 (aka proto2), which is why the version number
90 started from v2.0.0. From v3.0.0, a new language version (proto3) is
91 introduced while the old version (proto2) will continue to be supported.
92
93 The main intent of introducing proto3 is to clean up protobuf before
94 pushing the language as the foundation of Google's new API platform.
95 In proto3, the language is simplified, both for ease of use and to
96 make it available in a wider range of programming languages. At the
97 same time a few features are added to better support common idioms
98 found in APIs.
99
100 The following are the main new features in language version 3:
101
102 1. Removal of field presence logic for primitive value fields, removal
103 of required fields, and removal of default values. This makes proto3
104 significantly easier to implement with open struct representations,
105 as in languages like Android Java, Objective C, or Go.
106 2. Removal of unknown fields.
107 3. Removal of extensions, which are instead replaced by a new standard
108 type called Any.
109 4. Fix semantics for unknown enum values.
110 5. Addition of maps.
111 6. Addition of a small set of standard types for representation of time,
112 dynamic data, etc.
113 7. A well-defined encoding in JSON as an alternative to binary proto
114 encoding.
115
116 This release (v3.0.0-alpha-1) includes partial proto3 support for C++ and
117 Java. Items 6 (well-known types) and 7 (JSON format) in the above feature
118 list are not impelmented.
119
120 A new notion "syntax" is introduced to specify whether a .proto file
121 uses proto2 or proto3:
122
123 // foo.proto
124 syntax = "proto3";
125 message Bar {...}
126
127 If omitted, the protocol compiler will generate a warning and "proto2" will
128 be used as the default. This warning will be turned into an error in a
129 future release.
130
131 We recommend that new Protocol Buffers users use proto3. However, we do not
132 generally recommend that existing users migrate from proto2 from proto3 due
133 to API incompatibility, and we will continue to support proto2 for a long
134 time.
135
136 * Added support for map fields (implemented in C++/Java for both proto2 and
137 proto3).
138
139 Map fields can be declared using the following syntax:
140
141 message Foo {
142 map<string, string> values = 1;
143 }
144
145 Data of a map field will be stored in memory as an unordered map and it
146 can be accessed through generated accessors.
147
148 C++
149 * Added arena allocation support (for both proto2 and proto3).
150
151 Profiling shows memory allocation and deallocation constitutes a significant
152 fraction of CPU-time spent in protobuf code and arena allocation is a
153 technique introduced to reduce this cost. With arena allocation, new
154 objects will be allocated from a large piece of preallocated memory and
155 deallocation of these objects is almost free. Early adoption shows 20% to
156 50% improvement in some Google binaries.
157
158 To enable arena support, add the following option to your .proto file:
159
160 option cc_enable_arenas = true;
161
162 Protocol compiler will generate additional code to make the generated
163 message classes work with arenas. This does not change the existing API
164 of protobuf messages and does not affect wire format. Your existing code
165 should continue to work after adding this option. In the future we will
166 make this option enabled by default.
167
168 To actually take advantage of arena allocation, you need to use the arena
169 APIs when creating messages. A quick example of using the arena API:
170
171 {
172 google::protobuf::Arena arena;
173 // Allocate a protobuf message in the arena.
174 MyMessage* message = Arena::CreateMessage<MyMessage>(&arena);
175 // All submessages will be allocated in the same arena.
176 if (!message->ParseFromString(data)) {
177 // Deal with malformed input data.
178 }
179 // Must not delete the message here. It will be deleted automatically
180 // when the arena is destroyed.
181 }
182
183 Currently arena does not work with map fields. Enabling arena in a .proto
184 file containing map fields will result in compile errors in the generated
185 code. This will be addressed in a future release.
186
Feng Xiaobba83652014-10-20 17:06:06 -07001872014-10-20 version 2.6.1:
Feng Xiao57b86722014-10-09 11:20:08 -0700188
189 C++
190 * Added atomicops support for Solaris.
191 * Released memory allocated by InitializeDefaultRepeatedFields() and
192 GetEmptyString(). Some memory sanitizers reported them as memory leaks.
193
194 Java
195 * Updated DynamicMessage.setField() to handle repeated enum values
196 correctly.
197 * Fixed a bug that caused NullPointerException to be thrown when
198 converting manually constructed FileDescriptorProto to
199 FileDescriptor.
200
201 Python
Feng Xiao419c94b2014-10-09 11:40:02 -0700202 * Fixed WhichOneof() to work with de-serialized protobuf messages.
Feng Xiao57b86722014-10-09 11:20:08 -0700203 * Fixed a missing file problem of Python C++ implementation.
204
jieluo@google.com1eba9d92014-08-25 20:17:53 +00002052014-08-15 version 2.6.0:
206
207 General
208 * Added oneofs(unions) feature. Fields in the same oneof will share
209 memory and at most one field can be set at the same time. Use the
210 oneof keyword to define a oneof like:
211 message SampleMessage {
212 oneof test_oneof {
213 string name = 4;
214 YourMessage sub_message = 9;
215 }
216 }
217 * Files, services, enums, messages, methods and enum values can be marked
218 as deprecated now.
219 * Added Support for list values, including lists of mesaages, when
220 parsing text-formatted protos in C++ and Java.
221 For example: foo: [1, 2, 3]
222
223 C++
224 * Enhanced customization on TestFormat printing.
225 * Added SwapFields() in reflection API to swap a subset of fields.
226 Added SetAllocatedMessage() in reflection API.
227 * Repeated primitive extensions are now packable. The
228 [packed=true] option only affects serializers. Therefore, it is
229 possible to switch a repeated extension field to packed format
230 without breaking backwards-compatibility.
231 * Various speed optimizations.
232
233 Java
234 * writeTo() method in ByteString can now write a substring to an
235 output stream. Added endWith() method for ByteString.
236 * ByteString and ByteBuffer are now supported in CodedInputStream
237 and CodedOutputStream.
238 * java_generate_equals_and_hash can now be used with the LITE_RUNTIME.
239
240 Python
241 * A new C++-backed extension module (aka "cpp api v2") that replaces the
242 old ("cpp api v1") one. Much faster than the pure Python code. This one
243 resolves many bugs and is recommended for general use over the
244 pure Python when possible.
245 * Descriptors now have enum_types_by_name and extension_types_by_name dict
246 attributes.
247 * Support for Python 3.
248
xiaofeng@google.com2c9392f2013-02-28 06:12:28 +00002492013-02-27 version 2.5.0:
xiaofeng@google.comb55a20f2012-09-22 02:40:50 +0000250
251 General
252 * New notion "import public" that allows a proto file to forward the content
253 it imports to its importers. For example,
254 // foo.proto
255 import public "bar.proto";
256 import "baz.proto";
257
258 // qux.proto
259 import "foo.proto";
260 // Stuff defined in bar.proto may be used in this file, but stuff from
261 // baz.proto may NOT be used without importing it explicitly.
262 This is useful for moving proto files. To move a proto file, just leave
263 a single "import public" in the old proto file.
264 * New enum option "allow_alias" that specifies whether different symbols can
265 be assigned the same numeric value. Default value is "true". Setting it to
266 false causes the compiler to reject enum definitions where multiple symbols
267 have the same numeric value.
xiaofeng@google.com7f4c9e82013-03-05 01:51:21 +0000268 Note: We plan to flip the default value to "false" in a future release.
269 Projects using enum aliases should set the option to "true" in their .proto
270 files.
xiaofeng@google.comb55a20f2012-09-22 02:40:50 +0000271
272 C++
273 * New generated method set_allocated_foo(Type* foo) for message and string
274 fields. This method allows you to set the field to a pre-allocated object
275 and the containing message takes the ownership of that object.
276 * Added SetAllocatedExtension() and ReleaseExtension() to extensions API.
277 * Custom options are now formatted correctly when descriptors are printed in
278 text format.
279 * Various speed optimizations.
280
281 Java
282 * Comments in proto files are now collected and put into generated code as
283 comments for corresponding classes and data members.
284 * Added Parser to parse directly into messages without a Builder. For
285 example,
xiaofeng@google.com2c9392f2013-02-28 06:12:28 +0000286 Foo foo = Foo.PARSER.ParseFrom(input);
xiaofeng@google.comb55a20f2012-09-22 02:40:50 +0000287 Using Parser is ~25% faster than using Builder to parse messages.
288 * Added getters/setters to access the underlying ByteString of a string field
289 directly.
290 * ByteString now supports more operations: substring(), prepend(), and
291 append(). The implementation of ByteString uses a binary tree structure
292 to support these operations efficiently.
293 * New method findInitializationErrors() that lists all missing required
294 fields.
295 * Various code size and speed optimizations.
296
297 Python
298 * Added support for dynamic message creation. DescriptorDatabase,
299 DescriptorPool, and MessageFactory work like their C++ couterparts to
300 simplify Descriptor construction from *DescriptorProtos, and MessageFactory
301 provides a message instance from a Descriptor.
302 * Added pickle support for protobuf messages.
303 * Unknown fields are now preserved after parsing.
304 * Fixed bug where custom options were not correctly populated. Custom
305 options can be accessed now.
306 * Added EnumTypeWrapper that provides better accessibility to enum types.
307 * Added ParseMessage(descriptor, bytes) to generate a new Message instance
308 from a descriptor and a byte string.
309
liujisi@google.com5d996322011-04-30 15:29:09 +00003102011-05-01 version 2.4.1:
311
312 C++
313 * Fixed the frendship problem for old compilers to make the library now gcc 3
314 compatible again.
315 * Fixed vcprojects/extract_includes.bat to extract compiler/plugin.h.
316
317 Java
318 * Removed usages of JDK 1.6 only features to make the library now JDK 1.5
319 compatible again.
320 * Fixed a bug about negative enum values.
321 * serialVersionUID is now defined in generated messages for java serializing.
322 * Fixed protoc to use java.lang.Object, which makes "Object" now a valid
323 message name again.
324
325 Python
326 * Experimental C++ implementation now requires C++ protobuf library installed.
327 See the README.txt in the python directory for details.
328
liujisi@google.com7a261472011-02-02 14:04:22 +00003292011-02-02 version 2.4.0:
liujisi@google.com33165fe2010-11-02 13:14:58 +0000330
331 General
332 * The RPC (cc|java|py)_generic_services default value is now false instead of
333 true.
334 * Custom options can have aggregate types. For example,
335 message MyOption {
336 optional string comment = 1;
337 optional string author = 2;
338 }
339 extend google.protobuf.FieldOptions {
340 optional MyOption myoption = 12345;
341 }
342 This option can now be set as follows:
343 message SomeType {
344 optional int32 field = 1 [(myoption) = { comment:'x' author:'y' }];
345 }
346
347 C++
348 * Various speed and code size optimizations.
349 * Added a release_foo() method on string and message fields.
350 * Fixed gzip_output_stream sub-stream handling.
351
352 Java
353 * Builders now maintain sub-builders for sub-messages. Use getFooBuilder() to
354 get the builder for the sub-message "foo". This allows you to repeatedly
355 modify deeply-nested sub-messages without rebuilding them.
356 * Builder.build() no longer invalidates the Builder for generated messages
357 (You may continue to modify it and then build another message).
358 * Code generator will generate efficient equals() and hashCode()
359 implementations if new option java_generate_equals_and_hash is enabled.
360 (Otherwise, reflection-based implementations are used.)
361 * Generated messages now implement Serializable.
362 * Fields with [deprecated=true] will be marked with @Deprecated in Java.
363 * Added lazy conversion of UTF-8 encoded strings to String objects to improve
364 performance.
365 * Various optimizations.
366 * Enum value can be accessed directly, instead of calling getNumber() on the
367 enum member.
368 * For each enum value, an integer constant is also generated with the suffix
369 _VALUE.
370
371 Python
372 * Added an experimental C++ implementation for Python messages via a Python
373 extension. Implementation type is controlled by an environment variable
374 PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION (valid values: "cpp" and "python")
375 The default value is currently "python" but will be changed to "cpp" in
376 future release.
377 * Improved performance on message instantiation significantly.
378 Most of the work on message instantiation is done just once per message
379 class, instead of once per message instance.
380 * Improved performance on text message parsing.
381 * Allow add() to forward keyword arguments to the concrete class.
382 E.g. instead of
383 item = repeated_field.add()
384 item.foo = bar
385 item.baz = quux
386 You can do:
387 repeated_field.add(foo=bar, baz=quux)
388 * Added a sort() interface to the BaseContainer.
389 * Added an extend() method to repeated composite fields.
390 * Added UTF8 debug string support.
391
temporald4e38c72010-01-09 07:35:50 +00003922010-01-08 version 2.3.0:
kenton@google.comfccb1462009-12-18 02:11:36 +0000393
394 General
395 * Parsers for repeated numeric fields now always accept both packed and
396 unpacked input. The [packed=true] option only affects serializers.
397 Therefore, it is possible to switch a field to packed format without
398 breaking backwards-compatibility -- as long as all parties are using
399 protobuf 2.3.0 or above, at least.
400 * The generic RPC service code generated by the C++, Java, and Python
401 generators can be disabled via file options:
402 option cc_generic_services = false;
403 option java_generic_services = false;
404 option py_generic_services = false;
405 This allows plugins to generate alternative code, possibly specific to some
406 particular RPC implementation.
407
408 protoc
409 * Now supports a plugin system for code generators. Plugins can generate
410 code for new languages or inject additional code into the output of other
411 code generators. Plugins are just binaries which accept a protocol buffer
412 on stdin and write a protocol buffer to stdout, so they may be written in
413 any language. See src/google/protobuf/compiler/plugin.proto.
kenton@google.com7f4938b2009-12-22 22:57:39 +0000414 **WARNING**: Plugins are experimental. The interface may change in a
415 future version.
kenton@google.com0225b352010-01-04 22:07:09 +0000416 * If the output location ends in .zip or .jar, protoc will write its output
417 to a zip/jar archive instead of a directory. For example:
418 protoc --java_out=myproto_srcs.jar --python_out=myproto.zip myproto.proto
419 Currently the archive contents are not compressed, though this could change
420 in the future.
kenton@google.comfccb1462009-12-18 02:11:36 +0000421 * inf, -inf, and nan can now be used as default values for float and double
422 fields.
423
424 C++
425 * Various speed and code size optimizations.
426 * DynamicMessageFactory is now fully thread-safe.
427 * Message::Utf8DebugString() method is like DebugString() but avoids escaping
428 UTF-8 bytes.
429 * Compiled-in message types can now contain dynamic extensions, through use
430 of CodedInputStream::SetExtensionRegistry().
kenton@google.comc0ee4d22009-12-22 02:05:33 +0000431 * Now compiles shared libraries (DLLs) by default on Cygwin and MinGW, to
432 match other platforms. Use --disable-shared to avoid this.
kenton@google.comfccb1462009-12-18 02:11:36 +0000433
434 Java
435 * parseDelimitedFrom() and mergeDelimitedFrom() now detect EOF and return
436 false/null instead of throwing an exception.
437 * Fixed some initialization ordering bugs.
438 * Fixes for OpenJDK 7.
439
440 Python
441 * 10-25 times faster than 2.2.0, still pure-Python.
442 * Calling a mutating method on a sub-message always instantiates the message
443 in its parent even if the mutating method doesn't actually mutate anything
444 (e.g. parsing from an empty string).
445 * Expanded descriptors a bit.
446
kenton@google.com201b9be2009-08-12 00:23:05 +00004472009-08-11 version 2.2.0:
kenton@google.comceb561d2009-06-25 19:05:36 +0000448
449 C++
kenton@google.com80b1d622009-07-29 01:13:20 +0000450 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
451 to generate code which only depends libprotobuf-lite, which is much smaller
452 than libprotobuf but lacks descriptors, reflection, and some other features.
kenton@google.comceb561d2009-06-25 19:05:36 +0000453 * Fixed bug where Message.Swap(Message) was only implemented for
454 optimize_for_speed. Swap now properly implemented in both modes
455 (Issue 91).
456 * Added RemoveLast and SwapElements(index1, index2) to Reflection
457 interface for repeated elements.
458 * Added Swap(Message) to Reflection interface.
kenton@google.comd2fd0632009-07-24 01:00:35 +0000459 * Floating-point literals in generated code that are intended to be
460 single-precision now explicitly have 'f' suffix to avoid pedantic warnings
461 produced by some compilers.
kenton@google.com80b1d622009-07-29 01:13:20 +0000462 * The [deprecated=true] option now causes the C++ code generator to generate
463 a GCC-style deprecation annotation (no-op on other compilers).
464 * google::protobuf::GetEnumDescriptor<SomeGeneratedEnumType>() returns the
465 EnumDescriptor for that type -- useful for templates which cannot call
466 SomeGeneratedEnumType_descriptor().
467 * Various optimizations and obscure bug fixes.
468
469 Java
470 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
471 to generate code which only depends libprotobuf-lite, which is much smaller
472 than libprotobuf but lacks descriptors, reflection, and some other features.
kenton@google.com80b1d622009-07-29 01:13:20 +0000473 * Lots of style cleanups.
474
475 Python
476 * Fixed endianness bug with floats and doubles.
477 * Text format parsing support.
478 * Fix bug with parsing packed repeated fields in embedded messages.
479 * Ability to initialize fields by passing keyword args to constructor.
480 * Support iterators in extend and __setslice__ for containers.
kenton@google.comceb561d2009-06-25 19:05:36 +0000481
kenton@google.com1fb3d392009-05-13 23:20:03 +00004822009-05-13 version 2.1.0:
kenton@google.com2d6daa72009-01-22 01:27:00 +0000483
484 General
485 * Repeated fields of primitive types (types other that string, group, and
486 nested messages) may now use the option [packed = true] to get a more
487 efficient encoding. In the new encoding, the entire list is written
488 as a single byte blob using the "length-delimited" wire type. Within
489 this blob, the individual values are encoded the same way they would
490 be normally except without a tag before each value (thus, they are
491 tightly "packed").
kenton@google.comcfa2d8a2009-04-18 00:02:12 +0000492 * For each field, the generated code contains an integer constant assigned
493 to the field number. For example, the .proto file:
494 message Foo { optional int bar_baz = 123; }
495 would generate the following constants, all with the integer value 123:
496 C++: Foo::kBarBazFieldNumber
497 Java: Foo.BAR_BAZ_FIELD_NUMBER
498 Python: Foo.BAR_BAZ_FIELD_NUMBER
499 Constants are also generated for extensions, with the same naming scheme.
500 These constants may be used as switch cases.
kenton@google.com37ad00d2009-04-21 21:00:39 +0000501 * Updated bundled Google Test to version 1.3.0. Google Test is now bundled
502 in its verbatim form as a nested autoconf package, so you can drop in any
503 other version of Google Test if needed.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000504 * optimize_for = SPEED is now the default, by popular demand. Use
505 optimize_for = CODE_SIZE if code size is more important in your app.
506 * It is now an error to define a default value for a repeated field.
507 Previously, this was silently ignored (it had no effect on the generated
508 code).
509 * Fields can now be marked deprecated like:
510 optional int32 foo = 1 [deprecated = true];
511 Currently this does not have any actual effect, but in the future the code
512 generators may generate deprecation annotations in each language.
kenton@google.com9824eda2009-05-06 17:49:37 +0000513 * Cross-compiling should now be possible using the --with-protoc option to
514 configure. See README.txt for more info.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000515
kenton@google.comf663b162009-04-15 19:50:54 +0000516 protoc
517 * --error_format=msvs option causes errors to be printed in Visual Studio
518 format, which should allow them to be clicked on in the build log to go
kenton@google.comd37d46d2009-04-25 02:53:47 +0000519 directly to the error location.
520 * The type name resolver will no longer resolve type names to fields. For
521 example, this now works:
522 message Foo {}
523 message Bar {
524 optional int32 Foo = 1;
525 optional Foo baz = 2;
526 }
527 Previously, the type of "baz" would resolve to "Bar.Foo", and you'd get
528 an error because Bar.Foo is a field, not a type. Now the type of "baz"
529 resolves to the message type Foo. This change is unlikely to make a
530 difference to anyone who follows the Protocol Buffers style guide.
kenton@google.comf663b162009-04-15 19:50:54 +0000531
kenton@google.com2d6daa72009-01-22 01:27:00 +0000532 C++
kenton@google.comd37d46d2009-04-25 02:53:47 +0000533 * Several optimizations, including but not limited to:
534 - Serialization, especially to flat arrays, is 10%-50% faster, possibly
535 more for small objects.
536 - Several descriptor operations which previously required locking no longer
537 do.
538 - Descriptors are now constructed lazily on first use, rather than at
539 process startup time. This should save memory in programs which do not
540 use descriptors or reflection.
541 - UnknownFieldSet completely redesigned to be more efficient (especially in
542 terms of memory usage).
543 - Various optimizations to reduce code size (though the serialization speed
544 optimizations increased code size).
kenton@google.com2d6daa72009-01-22 01:27:00 +0000545 * Message interface has method ParseFromBoundedZeroCopyStream() which parses
546 a limited number of bytes from an input stream rather than parsing until
547 EOF.
kenton@google.come59427a2009-04-16 22:30:56 +0000548 * GzipInputStream and GzipOutputStream support reading/writing gzip- or
549 zlib-compressed streams if zlib is available.
550 (google/protobuf/io/gzip_stream.h)
kenton@google.comd37d46d2009-04-25 02:53:47 +0000551 * DescriptorPool::FindAllExtensions() and corresponding
552 DescriptorDatabase::FindAllExtensions() can be used to enumerate all
553 extensions of a given type.
554 * For each enum type Foo, protoc will generate functions:
555 const string& Foo_Name(Foo value);
556 bool Foo_Parse(const string& name, Foo* result);
557 The former returns the name of the enum constant corresponding to the given
558 value while the latter finds the value corresponding to a name.
559 * RepeatedField and RepeatedPtrField now have back-insertion iterators.
560 * String fields now have setters that take a char* and a size, in addition
561 to the existing ones that took char* or const string&.
562 * DescriptorPool::AllowUnknownDependencies() may be used to tell
563 DescriptorPool to create placeholder descriptors for unknown entities
564 referenced in a FileDescriptorProto. This can allow you to parse a .proto
565 file without having access to other .proto files that it imports, for
566 example.
567 * Updated gtest to latest version. The gtest package is now included as a
568 nested autoconf package, so it should be able to drop new versions into the
569 "gtest" subdirectory without modification.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000570
571 Java
572 * Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
573 * Message interface has new method toBuilder() which is equivalent to
574 newBuilderForType().mergeFrom(this).
575 * All enums now implement the ProtocolMessageEnum interface.
576 * Setting a field to null now throws NullPointerException.
577 * Fixed tendency for TextFormat's parsing to overflow the stack when
578 parsing large string values. The underlying problem is with Java's
579 regex implementation (which unfortunately uses recursive backtracking
580 rather than building an NFA). Worked around by making use of possesive
581 quantifiers.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000582 * Generated service classes now also generate pure interfaces. For a service
583 Foo, Foo.Interface is a pure interface containing all of the service's
584 defined methods. Foo.newReflectiveService() can be called to wrap an
585 instance of this interface in a class that implements the generic
586 RpcService interface, which provides reflection support that is usually
587 needed by RPC server implementations.
588 * RPC interfaces now support blocking operation in addition to non-blocking.
589 The protocol compiler generates separate blocking and non-blocking stubs
590 which operate against separate blocking and non-blocking RPC interfaces.
591 RPC implementations will have to implement the new interfaces in order to
592 support blocking mode.
593 * New I/O methods parseDelimitedFrom(), mergeDelimitedFrom(), and
594 writeDelimitedTo() read and write "delemited" messages from/to a stream,
595 meaning that the message size precedes the data. This way, you can write
596 multiple messages to a stream without having to worry about delimiting
597 them yourself.
598 * Throw a more descriptive exception when build() is double-called.
599 * Add a method to query whether CodedInputStream is at the end of the input
600 stream.
601 * Add a method to reset a CodedInputStream's size counter; useful when
602 reading many messages with the same stream.
603 * equals() and hashCode() now account for unknown fields.
pesho.petrov87e64e12008-12-24 01:07:22 +0000604
605 Python
606 * Added slicing support for repeated scalar fields. Added slice retrieval and
607 removal of repeated composite fields.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000608 * Updated RPC interfaces to allow for blocking operation. A client may
609 now pass None for a callback when making an RPC, in which case the
610 call will block until the response is received, and the response
611 object will be returned directly to the caller. This interface change
612 cannot be used in practice until RPC implementations are updated to
613 implement it.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000614 * Changes to input_stream.py should make protobuf compatible with appengine.
pesho.petrov87e64e12008-12-24 01:07:22 +0000615
kenton@google.com9f175282008-11-25 19:37:10 +00006162008-11-25 version 2.0.3:
617
618 protoc
619 * Enum values may now have custom options, using syntax similar to field
620 options.
621 * Fixed bug where .proto files which use custom options but don't actually
622 define them (i.e. they import another .proto file defining the options)
623 had to explicitly import descriptor.proto.
624 * Adjacent string literals in .proto files will now be concatenated, like in
625 C.
kenton@google.com2f669cb2008-12-02 05:59:15 +0000626 * If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and
627 the import path only contains "." (or contains "." but does not contain
628 the file), protoc incorrectly thought that the file was under ".", because
629 it thought that the path was relative (since it didn't start with a slash).
630 This has been fixed.
kenton@google.com9f175282008-11-25 19:37:10 +0000631
632 C++
633 * Generated message classes now have a Swap() method which efficiently swaps
634 the contents of two objects.
635 * All message classes now have a SpaceUsed() method which returns an estimate
636 of the number of bytes of allocated memory currently owned by the object.
637 This is particularly useful when you are reusing a single message object
638 to improve performance but want to make sure it doesn't bloat up too large.
639 * New method Message::SerializeAsString() returns a string containing the
640 serialized data. May be more convenient than calling
641 SerializeToString(string*).
642 * In debug mode, log error messages when string-type fields are found to
643 contain bytes that are not valid UTF-8.
644 * Fixed bug where a message with multiple extension ranges couldn't parse
645 extensions.
646 * Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on
647 a message that contained no fields (but possibly contained extensions).
648 * Fixed ShortDebugString() to not be O(n^2). Durr.
649 * Fixed crash in TextFormat parsing if the first token in the input caused a
650 tokenization error.
651 * Fixed obscure bugs in zero_copy_stream_impl.cc.
652 * Added support for HP C++ on Tru64.
653 * Only build tests on "make check", not "make".
654 * Fixed alignment issue that caused crashes when using DynamicMessage on
655 64-bit Sparc machines.
656 * Simplify template usage to work with MSVC 2003.
657 * Work around GCC 4.3.x x86_64 compiler bug that caused crashes on startup.
658 (This affected Fedora 9 in particular.)
kenton@google.com25bc5cd2008-12-04 20:34:50 +0000659 * Now works on "Solaris 10 using recent Sun Studio".
kenton@google.com9f175282008-11-25 19:37:10 +0000660
661 Java
662 * New overload of mergeFrom() which parses a slice of a byte array instead
663 of the whole thing.
664 * New method ByteString.asReadOnlyByteBuffer() does what it sounds like.
665 * Improved performance of isInitialized() when optimizing for code size.
666
667 Python
668 * Corrected ListFields() signature in Message base class to match what
669 subclasses actually implement.
670 * Some minor refactoring.
kenton@google.com2f669cb2008-12-02 05:59:15 +0000671 * Don't pass self as first argument to superclass constructor (no longer
672 allowed in Python 2.6).
kenton@google.com9f175282008-11-25 19:37:10 +0000673
kenton@google.com9b10f582008-09-30 00:09:40 +00006742008-09-29 version 2.0.2:
675
kenton@google.com24bf56f2008-09-24 20:31:01 +0000676 General
677 * License changed from Apache 2.0 to New BSD.
678 * It is now possible to define custom "options", which are basically
679 annotations which may be placed on definitions in a .proto file.
680 For example, you might define a field option called "foo" like so:
681 import "google/protobuf/descriptor.proto"
682 extend google.protobuf.FieldOptions {
683 optional string foo = 12345;
684 }
685 Then you annotate a field using the "foo" option:
686 message MyMessage {
687 optional int32 some_field = 1 [(foo) = "bar"]
688 }
689 The value of this option is then visible via the message's
690 Descriptor:
691 const FieldDescriptor* field =
692 MyMessage::descriptor()->FindFieldByName("some_field");
693 assert(field->options().GetExtension(foo) == "bar");
694 This feature has been implemented and tested in C++ and Java.
695 Other languages may or may not need to do extra work to support
696 custom options, depending on how they construct descriptors.
697
698 C++
699 * Fixed some GCC warnings that only occur when using -pedantic.
700 * Improved static initialization code, making ordering more
701 predictable among other things.
702 * TextFormat will no longer accept messages which contain multiple
703 instances of a singular field. Previously, the latter instance
kenton@google.com9b10f582008-09-30 00:09:40 +0000704 would overwrite the former.
kenton@google.com24bf56f2008-09-24 20:31:01 +0000705 * Now works on systems that don't have hash_map.
706
kenton@google.com9b10f582008-09-30 00:09:40 +0000707 Java
708 * Print @Override annotation in generated code where appropriate.
709
kenton@google.com24bf56f2008-09-24 20:31:01 +0000710 Python
711 * Strings now use the "unicode" type rather than the "str" type.
712 String fields may still be assigned ASCII "str" values; they will
713 automatically be converted.
714 * Adding a property to an object representing a repeated field now
715 raises an exception. For example:
716 # No longer works (and never should have).
717 message.some_repeated_field.foo = 1
kenton@google.com9b10f582008-09-30 00:09:40 +0000718
719 Windows
720 * We now build static libraries rather than DLLs by default on MSVC.
721 See vsprojects/readme.txt for more information.
722
temporala44f3c32008-08-15 18:32:02 +00007232008-08-15 version 2.0.1:
kenton@google.com9b10f582008-09-30 00:09:40 +0000724
725 protoc
726 * New flags --encode and --decode can be used to convert between protobuf text
727 format and binary format from the command-line.
728 * New flag --descriptor_set_out can be used to write FileDescriptorProtos for
729 all parsed files directly into a single output file. This is particularly
730 useful if you wish to parse .proto files from programs written in languages
731 other than C++: just run protoc as a background process and have it output
732 a FileDescriptorList, then parse that natively.
733 * Improved error message when an enum value's name conflicts with another
734 symbol defined in the enum type's scope, e.g. if two enum types declared
735 in the same scope have values with the same name. This is disallowed for
temporala44f3c32008-08-15 18:32:02 +0000736 compatibility with C++, but this wasn't clear from the error.
kenton@google.com9b10f582008-09-30 00:09:40 +0000737 * Fixed absolute output paths on Windows.
temporala44f3c32008-08-15 18:32:02 +0000738 * Allow trailing slashes in --proto_path mappings.
kenton@google.com9b10f582008-09-30 00:09:40 +0000739
740 C++
741 * Reflection objects are now per-class rather than per-instance. To make this
742 possible, the Reflection interface had to be changed such that all methods
743 take the Message instance as a parameter. This change improves performance
744 significantly in memory-bandwidth-limited use cases, since it makes the
745 message objects smaller. Note that source-incompatible interface changes
746 like this will not be made again after the library leaves beta.
temporala44f3c32008-08-15 18:32:02 +0000747 * Heuristically detect sub-messages when printing unknown fields.
kenton@google.com9b10f582008-09-30 00:09:40 +0000748 * Fix static initialization ordering bug that caused crashes at startup when
temporala44f3c32008-08-15 18:32:02 +0000749 compiling on Mac with static linking.
kenton@google.com9b10f582008-09-30 00:09:40 +0000750 * Fixed TokenizerTest when compiling with -DNDEBUG on Linux.
751 * Fixed incorrect definition of kint32min.
temporala44f3c32008-08-15 18:32:02 +0000752 * Fix bytes type setter to work with byte sequences with embedded NULLs.
753 * Other irrelevant tweaks.
754
kenton@google.com9b10f582008-09-30 00:09:40 +0000755 Java
756 * Fixed UnknownFieldSet's parsing of varints larger than 32 bits.
757 * Fixed TextFormat's parsing of "inf" and "nan".
758 * Fixed TextFormat's parsing of comments.
759 * Added info to Java POM that will be required when we upload the
temporala44f3c32008-08-15 18:32:02 +0000760 package to a Maven repo.
761
kenton@google.com9b10f582008-09-30 00:09:40 +0000762 Python
763 * MergeFrom(message) and CopyFrom(message) are now implemented.
764 * SerializeToString() raises an exception if the message is missing required
765 fields.
766 * Code organization improvements.
767 * Fixed doc comments for RpcController and RpcChannel, which had somehow been
temporala44f3c32008-08-15 18:32:02 +0000768 swapped.
kenton@google.com9b10f582008-09-30 00:09:40 +0000769 * Fixed text_format_test on Windows where floating-point exponents sometimes
770 contain extra zeros.
temporala44f3c32008-08-15 18:32:02 +0000771 * Fix Python service CallMethod() implementation.
772
773 Other
774 * Improved readmes.
775 * VIM syntax highlighting improvements.
776
temporal40ee5512008-07-10 02:12:20 +00007772008-07-07 version 2.0.0:
778
779 * First public release.