It is based on V8's new CallOnce(): http://codereview.chromium.org/9447052/.
This patch includes the following changes:
- POD (no static initializer generated) and faster implementation on Windows.
- GoogleOnceInit() can now take an additional parameter which is forwarded to
the function provided by the user.
This patch is part of the static initializers removal initiative.
Many improvements, too many to mention. One significant
perf regression warrants investigation:
omitfp.parsetoproto2_googlemessage1.upb_jit: 343 -> 252 (-26.53)
plain.parsetoproto2_googlemessage1.upb_jit: 334 -> 251 (-24.85)
25% regression for this benchmark is bad, but since I don't think
there's any fundamental design issue that caused it I'm going to
go ahead with the commit anyway. Can investigate and fix later.
Other benchmarks were neutral or showed slight improvement.
Added a upb_byteregion that tracks a region of
the input buffer; decoders use this instead of
using a upb_bytesrc directly. upb_byteregion
is also used as the way of passing a string to
a upb_handlers callback. This symmetry makes
decoders compose better; if you want to take
a parsed string and decode it as something else,
you can take the string directly from the callback
and feed it as input to another parser.
A commented-out version of a pinning interface
is present; I decline to actually implement it
(and accept its extra complexity) until/unless
it is clear that it is actually a win. But it
is included as a proof-of-concept, to show that
it fits well with the existing interface.
1. Refactoring of build to allow multiple target frameworks
2. Addition of multiple Silverlight versions
3. Renamed *_Silverlight2 configurations to *_Silverlight
4. Added batch files for each framework build (Build20, Build35, Build40)
5. Moved the package building into MSBuild tasks
6. BuildAll.bat now builds all packages in one build
7. Removed Generate*Package.bat batch files (replaced by BuildAll.bat)
8. Removed the ability to build with 3.5 MSBuild
9. Source is only generated with Release/2.0 build of ProtoGen
10. Removed unit testing proto files from packaging
11. Removed the remaining 'pause' statements from all batch files
12. RunBenchmarks target now builds with .NET 2.0 instead of 4.0
13. Benchmark arguments can now be specified with BenchmarkArgs parameter
14. ProtoBench now supports '/log:path' so console can still see progress
15. Updated PublishRelease.bat and *.nuspec for new build output
16. Updated ProtocolBuffers.Serialization.csproj to omit extensions for 2.0
17. Added NUnit console configurations for each .NET framework version