commit | 8510592326d1c5fb66b218b9634095d43f8f6b4e | [log] [tgz] |
---|---|---|
author | Mike Burrows <m3b@google.com> | Tue Aug 04 14:59:28 2015 -0700 |
committer | Mike Burrows <m3b@google.com> | Tue Aug 04 14:59:28 2015 -0700 |
tree | bace171451fec7bccf1158b74cca7ec1cb81491b | |
parent | 54cf188dabc61373286189739f54cfb925d2cdac [diff] |
v.io/v23/vom/internal: Vom benchmarks. No new functionality. (This is the second part of the CL, needed to check in the javascript form of the compiled VDL. :-( ) This CL adds benchmarks for vom, which marshal and unmarhsal an arbitrarily-chosen "customer record" struct, with a few strings and integers in it. The test measures the number of allocations and time used for: - encoding vs decoding - using vom.Encode/vom.Decode vs vom.Encoder.Encode/vom.Decoder.Decode - processing a single customer record vs a thousand - vom vs gob The comments at the top of the source give comparisons with C++ and Go protocol buffers. Typical output (including CL 14185): $ v23 go test -bench . v.io/v23/vom/internal Allocations per vom.Encode : 572 Allocations per vom.Decode : 405 Allocations per vom.Encoder.Encode (1 Customer) : 572 Allocations per vom.Encoder.Encode (1000 Customers): 74509 Allocations per vom.Decoder.Decode (1 Customer) : 4469 Allocations per vom.Decoder.Decode (1000 Customers): 405068 Allocations per gob.Encoder.Encode (1 Customer) : 53 Allocations per gob.Encoder.Encode (1000 Customers): 3073 Allocations per gob.Decoder.Decode (1 Customer) : 523 Allocations per gob.Decoder.Decode (1000 Customers): 14512 PASS BenchmarkVomEncodeCustomer 10000 149089 ns/op BenchmarkVomDecodeCustomer 20000 95148 ns/op BenchmarkVomEncoder1Customer 10000 150061 ns/op BenchmarkVomEncoder1000Customer 100 18691021 ns/op BenchmarkVomDecoder1Customer 2000 997658 ns/op BenchmarkVomDecoder1000Customer 20 85232430 ns/op BenchmarkGobEncoder1Customer 50000 30675 ns/op BenchmarkGobEncoder1000Customer 300 4227359 ns/op BenchmarkGobDecoder1Customer 10000 111041 ns/op BenchmarkGobDecoder1000Customer 500 3621498 ns/op ok v.io/v23/vom/internal 19.863s $ Without CL 14185, the vom/Decode lines are different: Allocations per vom.Decode : 4469 BenchmarkVomDecodeCustomer 2000 1007225 ns/op MultiPart: 2/2 Change-Id: I47f2422e73fb0e22e0a5eec6fc038d1031517b16
This repository defines the JavaScript API for Vanadium. The client and server APIs defined here work both in Node.js and the browser.
npm
can be used to install this library:
npm install --save git@github.com:vanadium/js.git
Documentation for this API is available at https://jsdoc.v.io/ Tutorials can be found at https://v.io/tutorials/javascript/
The entry point to the API is through a module called vanadium
, everything else is considered private and should not be accessed by the users of the API.
The vanadium
module is exported as a global in the browser JavaScript library and for Browserify and Node.js the “main” property in the package.json
points to /src/vanadium
making it the index module and therefore Browserify and Node.js users can gain access to the API with:
var vanadium = require("vanadium");
One of the goals of this project is to only write the code once and have it run in both Node.js and browsers. Therefore, specific build and testing steps have been designed in the project to ensure this goal.
When run in a browser, vanadium.js
expects that the vanadium extension will be installed.
Bugs and feature requests should be filed in the Vanadium issue tracker.
GNU Make is used to build and test Vanadium.
Build everything:
make build
Test everything:
make test
Run a specific test suite:
make test-unit make test-unit-node make test-unit-browser make test-integration make test-integration-node make test-integration-browser
Remove all build and testing artifacts:
make clean