Граф коммитов

118 Коммитов

Автор SHA1 Сообщение Дата
Matt Burke 4fa5e2e2d3 Benchmark dat msgpack 2017-04-21 09:03:53 -04:00
Charlie Somerville 1405542759 Merge pull request #11 from github/ci
Set up Travis CI
2017-01-12 12:17:20 +11:00
Charlie Somerville ca38663411 only serialise a Time object with microsecond precision
Time.now on Linux returns a Time instance with nanosecond precision,
but BERT only serialises times down to microsecond precision.
2017-01-12 12:13:18 +11:00
Charlie Somerville 57c7b1de79 test ruby and c implementations 2017-01-12 12:13:18 +11:00
Charlie Somerville 59692ed4a5 set up .travis.yml with ruby 2.3 and 2.4 2017-01-12 12:13:18 +11:00
Charlie Somerville 38fdbbf98d fix unused variable warnings when testing with -w 2017-01-12 12:13:18 +11:00
Charlie Somerville 0dcc7eee8f Merge pull request #9 from github/integer-unification
Ruby 2.4 support
2017-01-12 12:12:09 +11:00
Charlie Somerville 83ffa7f301 Merge pull request #10 from arthurschreiber/arthur/fix-encoding-failures
Make sure we only collect binary encoded strings in our buffer.
2017-01-12 12:05:00 +11:00
Arthur Schreiber 76fb02aca8 Make sure we only collect binary encoded strings in our buffer. 2017-01-11 10:10:14 +01:00
Charlie Somerville 3c96b8154c add test-unit as development dependency 2017-01-11 15:05:26 +11:00
Charlie Somerville 0aa53733e4 update rake dev development for ruby 2.4 2017-01-11 15:02:28 +11:00
Charlie Somerville 5ff7e73aa5 update yajl-ruby dev dependency for ruby 2.4 2017-01-11 15:01:37 +11:00
Charlie Somerville d8de16106a replace Fixnum and Bignum with Integer 2017-01-11 15:00:27 +11:00
Carlos Martín Nieto 2c645f789f The gem is actually yajl-ruby 2016-08-12 12:38:22 +02:00
Carlos Martín Nieto 778694ffd6 Add yajl as a deve dependency
We use it for the benchmarks, and it won't load if we haven't told
bundler we want it.
2016-08-12 12:24:49 +02:00
Carlos Martín Nieto 3edcf493b0 Merge pull request #8 from arthurschreiber/arthur/reduce-mem-usage
Don't use a StringIO when encoding data.
2016-08-12 12:23:38 +02:00
Arthur Schreiber 55cacadf2e Don't use a StringIO when encoding data.
When data is encoded to BERT, each individual, encoded result piece is stored inside an Array based Buffer. At the end, each piece is sequentially written out to a StringIO object and the underlying String is returned. Unfortunately, this sequential writing to StringIO causes a lot of growth of the internal String object. By calling `#join` on the Buffer internal Array, Ruby will allocate a single string that can contain the whole result in a single step.
2016-08-12 11:40:01 +02:00
Brian Lopez c489ecd510 Merge pull request #6 from github/write-1-speed
speed up `write_1` calls
2016-08-11 08:56:45 -07:00
Aaron Patterson 63758fe5c6
speed up `write_1` calls
We don't need to use `pack`, just `chr`.

Before:

```
[aaron@TC bert (write-1-speed)]$ ruby -I lib bench/encode_bench.rb
                    user     system      total        real
BERT tiny       0.020000   0.000000   0.020000 (  0.014491)
BERT small      0.130000   0.000000   0.130000 (  0.140019)
BERT large      0.450000   0.170000   0.620000 (  0.627474)
BERT complex    2.940000   0.020000   2.960000 (  2.981667)
```

After:

```
[aaron@TC bert (write-1-speed)]$ ruby -I lib bench/encode_bench.rb
                    user     system      total        real
BERT tiny       0.010000   0.000000   0.010000 (  0.011318)
BERT small      0.110000   0.000000   0.110000 (  0.110367)
BERT large      0.380000   0.170000   0.550000 (  0.565794)
BERT complex    2.210000   0.020000   2.230000 (  2.243591)
```
2016-08-10 10:55:06 -07:00
Carlos Martín Nieto d6abc9afc0 Merge pull request #5 from github/cmn/gemspec
Use rake-compiler
2016-08-10 19:45:34 +02:00
Carlos Martín Nieto 70220ecfdc Bring back the smaller 'large' decode payload
The actually-large payload is too large to be of particular use.
2016-05-23 15:33:08 +02:00
Carlos Martín Nieto 5a4e3a0cba Use rake-compiler
Don't reinvent this particular wheel. There's still a mention or two of
`.bundle` which is what we have on OS X. So some of the cleaning up
just did not work on anything else.
2016-05-23 15:33:07 +02:00
Carlos Martín Nieto 8ad737eac2 Don't require jeweler 2016-05-23 15:33:07 +02:00
Carlos Martín Nieto 276b3f4d81 Bump version to 1.1.10 2016-05-23 11:00:48 +02:00
Carlos Martín Nieto efd6aaad5a Merge pull request #4 from github/buffered-write
introduce a new buffered writer method
2016-05-23 10:58:00 +02:00
Aaron Patterson 2983829c66
introduce a new buffered writer method
This method will buffer writes, but to an array rather than to a
StringIO.  This allows us to calculate the size of the BERT packet that
we're going to send *without* copying large strings in to a new buffer.
Writes might take a bit more CPU, but will take fare less memory.
2016-05-20 11:23:43 -07:00
Aaron Patterson dd6090ef65
speed up string decoding
This speeds up string decoding by using `rb_str_substr` rather than
`rb_str_new`.  `rb_str_substr` will create shared strings, so it will
avoid string copying like `rb_str_new` will do.

Before this patch:

```
[aaron@TC bert (master)]$ ruby -I lib:test bench/decode_bench.rb
                    user     system      total        real
BERT C Extension Decoder
BERT tiny       0.000000   0.000000   0.000000 (  0.000574)
BERT small      0.010000   0.010000   0.020000 (  0.014938)
BERT large     13.990000  11.640000  25.630000 ( 25.892584)
BERT complex    0.030000   0.010000   0.040000 (  0.033596)
```

After this patch:

```
[aaron@TC bert (master)]$ ruby -I lib:test bench/decode_bench.rb
                    user     system      total        real
BERT C Extension Decoder
BERT tiny       0.000000   0.000000   0.000000 (  0.000563)
BERT small      0.010000   0.000000   0.010000 (  0.008701)
BERT large      6.180000   0.040000   6.220000 (  6.299307)
BERT complex    0.060000   0.000000   0.060000 (  0.070287)
```
2016-05-19 10:28:17 -07:00
Aaron Patterson 7ce2909f40 Merge pull request #3 from carlosmn/cmn/bundler
Bundlerize
2016-05-19 10:13:46 -07:00
Carlos Martín Nieto f72b45206f Bundlerize 2016-05-19 19:08:33 +02:00
Aaron Patterson d8ab58a63f
bumping version 2016-04-28 15:37:49 -07:00
Aaron Patterson a3d320e94d
Revert "Merge pull request #2 from github/utf8-or-binary-encoding"
This reverts commit 55e1855cde, reversing
changes made to 14e4818327.
2016-04-28 15:37:28 -07:00
Aaron Patterson dfe77a3314
bumping version 2016-04-28 11:08:43 -07:00
Aaron Patterson 55e1855cde Merge pull request #2 from github/utf8-or-binary-encoding
Convert strings to utf-8 or binary before sending them over the wire
2016-04-28 11:07:15 -07:00
Aaron Patterson a1866ac8b3
Convert strings to utf-8 or binary before sending them over the wire
It's turning out to be a pain for the client side to accept any
encoding.  This commit ensures that non-utf8 data is transcoded to utf8
or converted to binary before being sent across the wire.
2016-04-28 11:00:50 -07:00
Aaron Patterson 14e4818327 bumping to 1.1.7 2016-04-18 09:57:27 -07:00
Aaron Patterson fd47af65eb Merge pull request #1 from github/encoding
Make BERT encoding aware
2016-04-18 08:36:50 -07:00
Aaron Patterson 3113c6f395 add a comment about ERL types
The two new types are extensions, so this commit adds a comment
documenting what these extensions are for (namely so that we can support
string encodings over the wire).
2016-04-18 08:19:34 -07:00
Aaron Patterson 31ab659338 reduce diff 2016-04-14 15:32:04 -07:00
Aaron Patterson aa084e74f0 add two new types, unicode strings, and other encoded strings
This commit adds two new types, one for unicode strings and one for
other encoded strings.  Unocide strings have no extra wire protocol
overhead, where "other" strings send the encoding name along with the
string.
2016-04-14 15:00:46 -07:00
Aaron Patterson 4e78dc448a default encoder to version 1, enable version 2 with a flag
This commit makes the encoder default to version 1 of the BERT encoding
scheme, but allows you to turn on version 2 via a feature flag.
2016-04-13 18:11:59 -07:00
Aaron Patterson 70fd1ff6c0 make BERT aware of string encodings
This adds an encoding field after the string so that you can apply an
encoding to the string sent across the wire.
2016-04-13 17:57:00 -07:00
Aaron Patterson 3520318c39 move the decoder callbacks to the buf pointer
this way we can configure the callbacks to something else at runtime.
2016-04-13 17:05:06 -07:00
Aman Gupta c2abcc4868 bert 1.1.6 2012-05-25 15:03:29 -07:00
Aman Gupta 363155d4fe removing trailing whitespace /cc @schmurfy 2011-12-16 19:40:05 -08:00
Julien Ammous ff03a68665 fixed encoding for utf8 string in ruby 1.9 2011-12-16 12:35:28 +01:00
Aman Gupta 5e53995248 bert 1.1.5 2011-12-12 03:17:09 -08:00
Aman Gupta 7d573cff2f Fix tests on ruby 1.9 (closes #13) 2011-12-10 03:44:04 -08:00
Aman Gupta 813372b2b6 Merge pull request #14 from dgrijalva/master
Fix for encoding of negative bignums
2011-12-10 03:22:12 -08:00
yarsanukaev 727ee16156 Fix readme: complex type dictionary consisted of only 2 elements without 'bert' atom being the first element. 2011-12-10 03:19:07 -08:00
Aman Gupta c07dbb8b3a Merge pull request #15 from tanoku/master
Wash the face of the C decoder
2011-12-10 03:12:33 -08:00