edn_turbo 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41f78cfbb6704e1d0a4f7e1336d62609c3c10d18
4
- data.tar.gz: 0a8080b1e3356f9e6f743b27670ee9d8ccba4769
3
+ metadata.gz: a70e4427453a794f2ccaac6034998708b9784a7d
4
+ data.tar.gz: d7fe39621793765d1aabe054d68fe11ecaf39efa
5
5
  SHA512:
6
- metadata.gz: b45b5f73a05bee804ca8159d7e6b42ca39fde77545c7ed36a67b5f1197e7ac88e45a2e41a08179eba2f8ad6f7f5ab5bc51ee9f67cbbd12d8dbdbe0a95679df33
7
- data.tar.gz: 98f1c888c9eeb40fabd89f48a81a9e8178321393cb6f74e49d078b1ae8e1e1f39be8653c7bda51f37a45811cbcca97a99505439c0afa052da65fe4da25b148fe
6
+ metadata.gz: dbe5d42a67406237809cae635bd33d036a33fdf936fce7e2d80e767f4094ad7e056d5a4e6097c723a7177156e1064aed090b862985d319111bda1a613b585d14
7
+ data.tar.gz: c8dd167e57663ab45837b89dd6034b8e151f5d1b18d6abd853fb1dc842473a1267bdadc3c01aa8a9063fd9aa43df50dfd568088aef12844e3f103ccdfb214f52
data/README.md CHANGED
@@ -5,45 +5,26 @@ Ruby C-extension for parsing EDN files.
5
5
 
6
6
  Written based on the functionality of
7
7
  [edn](https://github.com/relevance/edn-ruby) but with the goal of
8
- achieving much faster parsing.
8
+ achieving much faster parsing.
9
9
 
10
10
  As of v0.2.0, `edn_turbo` requires `edn` to support tagged elements
11
- using a similar API and return types. The eventual goal is to bundle
11
+ using a similar API and return types. Eventually, I'd like to bundle
12
12
  `edn_turbo` as an optional parser for `edn`.
13
13
 
14
14
  Some quick sample runs comparing time output of file reads using `edn`
15
- and `edn_turbo`:
15
+ and `edn_turbo` (see [issue 12](https://github.com/relevance/edn-ruby/issues/12)):
16
16
 
17
- 1. 792K data file:
18
-
19
- ```
20
- with edn
21
-
22
- real 0m1.022s
23
- user 0m0.960s
24
- sys 0m0.047s
25
-
26
- with edn_turbo
27
-
28
- real 0m0.132s
29
- user 0m0.091s
30
- sys 0m0.038s
31
- ```
32
-
33
- 2. 43M data file:
34
-
35
- ```
36
- with edn
37
-
38
- real 0m55.922s
39
- user 0m55.155s
40
- sys 0m0.339s
41
-
42
- with edn_turbo
43
-
44
- real 0m1.976s
45
- user 0m1.844s
46
- sys 0m0.111s
17
+ ```ruby
18
+ irb(main):004:0> s = "[{\"x\" {\"id\" \"/model/952\", \"model_name\" \"person\", \"ancestors\" [\"record\" \"asset\"], \"format\" \"edn\"}, \"id\" 952, \"name\" nil, \"model_name\" \"person\", \"rel\" {}, \"description\" nil, \"age\" nil, \"updated_at\" nil, \"created_at\" nil, \"anniversary\" nil, \"job\" nil, \"start_date\" nil, \"username\" nil, \"vacation_start\" nil, \"vacation_end\" nil, \"expenses\" nil, \"rate\" nil, \"display_name\" nil, \"gross_profit_per_month\" nil}]"
19
+ => "[{\"x\" {\"id\" \"/model/952\", \"model_name\" \"person\", \"ancestors\" [\"record\" \"asset\"], \"format\" \"edn\"}, \"id\" 952, \"name\" nil, \"model_name\" \"person\", \"rel\" {}, \"description\" nil, \"age\" nil, \"updated_at\" nil, \"created_at\" nil, \"anniversary\" nil, \"job\" nil, \"start_date\" nil, \"username\" nil, \"vacation_start\" nil, \"vacation_end\" nil, \"expenses\" nil, \"rate\" nil, \"display_name\" nil, \"gross_profit_per_month\" nil}]"
20
+ irb(main):005:0> Benchmark.realtime { 100.times { EDN::read(s) } }
21
+ => 0.08602
22
+ irb(main):006:0> Benchmark.realtime { 100.times { EDNT::read(s) } }
23
+ => 0.005923
24
+ irb(main):007:0> Benchmark.realtime { 100000.times { EDN::read(s) } }
25
+ => 81.185499
26
+ irb(main):008:0> Benchmark.realtime { 100000.times { EDNT::read(s) } }
27
+ => 3.929506
47
28
  ```
48
29
 
49
30
  Dependencies
@@ -72,11 +53,6 @@ Usage
72
53
 
73
54
  Known problems
74
55
  ==============
75
- As of v0.2.0:
56
+ v0.2.2:
76
57
 
77
- - Need to support stand-alone `-` and `+` symbols as well as named
78
- symbols with a leading `-`. The current set of parsers expect only
79
- numeric values to optionally lead with a `-` so support for the
80
- other two cases requires refactoring of the parser logic
81
- - Need to check handling of discards at the root level. Discards
82
- within containers looks to work 100% as far as I know.
58
+ - Need to emulate EDN::Reader.each