edn_turbo 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +52 -12
- data/ext/edn_turbo/edn_parser.cc +504 -576
- data/ext/edn_turbo/edn_parser.h +12 -14
- data/ext/edn_turbo/edn_parser.rl +103 -175
- data/ext/edn_turbo/edn_parser_def.cc +22 -24
- data/ext/edn_turbo/edn_parser_unicode.cc +29 -0
- data/ext/edn_turbo/extconf.rb +23 -0
- data/ext/edn_turbo/main.cc +0 -1
- data/lib/edn_turbo/version.rb +1 -1
- data/test/test_output_diff.rb +9 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e0ee4c88910b841529aead1cb72598a52558bc5
|
4
|
+
data.tar.gz: 36a8ab68264720ebe0e7c5ffb20cb802a3b0a2ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b677553c38f822a5abcd4cb9601bd910f2246ec229b4c8bdecf9d47b5151ae000258fe4ef5e372901b1a54c8ee38c10ca785e0d234a6723bef3ef3fb7f2cb543
|
7
|
+
data.tar.gz: 8f0972fe531fe771b924c453965bf45c91622232fdf85a236e8fb9f44cd53a188cb34c081bd2fc4ec46d920d1d3a8a61d393359ae84a5027750071a033805903
|
data/README.md
CHANGED
@@ -1,30 +1,70 @@
|
|
1
|
-
|
1
|
+
edn_turbo
|
2
2
|
============
|
3
3
|
|
4
|
-
Ruby C-extension for EDN
|
4
|
+
Ruby C-extension for parsing EDN files.
|
5
|
+
|
6
|
+
Written based on the functionality of
|
7
|
+
[edn](https://github.com/relevance/edn-ruby) but with the goal of
|
8
|
+
achieving much faster parsing. Currently supports a subset of the EDN
|
9
|
+
spec, primarily that created from dumping ruby object data in EDN
|
10
|
+
format. Support for tagged elements, sets, and full unicode is coming
|
11
|
+
soon.
|
12
|
+
|
13
|
+
Some quick sample runs comparing time output of file reads using `edn`
|
14
|
+
and `edn_turbo`:
|
15
|
+
|
16
|
+
1. 792K data file:
|
17
|
+
|
18
|
+
```
|
19
|
+
with edn
|
20
|
+
|
21
|
+
real 0m1.022s
|
22
|
+
user 0m0.960s
|
23
|
+
sys 0m0.047s
|
24
|
+
|
25
|
+
with edn_turbo
|
26
|
+
|
27
|
+
real 0m0.132s
|
28
|
+
user 0m0.091s
|
29
|
+
sys 0m0.038s
|
30
|
+
```
|
31
|
+
|
32
|
+
2. 43M data file:
|
33
|
+
|
34
|
+
```
|
35
|
+
with edn
|
36
|
+
|
37
|
+
real 0m55.922s
|
38
|
+
user 0m55.155s
|
39
|
+
sys 0m0.339s
|
40
|
+
|
41
|
+
with edn_turbo
|
42
|
+
|
43
|
+
real 0m1.976s
|
44
|
+
user 0m1.844s
|
45
|
+
sys 0m0.111s
|
46
|
+
```
|
5
47
|
|
6
48
|
Dependencies
|
7
49
|
============
|
8
50
|
|
9
|
-
Minimum required versions shown of the following:
|
10
51
|
- ruby gems:
|
11
52
|
- [rake 10.3.2](http://rake.rubyforge.org)
|
12
53
|
- [rake-compiler 0.9.2](http://rake-compiler.rubyforge.org)
|
13
54
|
- [rice 1.7.0](http://rice.rubyforge.org)
|
55
|
+
- [icu4c](http://icu-project.org/apiref/icu4c/)
|
14
56
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
- Install gem dependencies:
|
57
|
+
`edn_turbo` uses a ragel-based parser but the generated .cc file is
|
58
|
+
bundled so ragel should not need to be installed.
|
19
59
|
|
20
|
-
```
|
21
|
-
gem install rake rake-compiler rice
|
22
|
-
```
|
23
60
|
|
24
61
|
Usage
|
25
62
|
=====
|
26
63
|
```ruby
|
27
|
-
require '
|
64
|
+
require 'edn_turbo'
|
28
65
|
|
29
|
-
|
66
|
+
File.open(filename) do |file|
|
67
|
+
output = EDNT.read(file)
|
68
|
+
pp output if output != nil
|
69
|
+
end
|
30
70
|
```
|