h8 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/README.md +10 -10
- data/benchmark/knightsmove.coffee +14 -2
- data/benchmark/knigthsmove.rb +1 -0
- data/hybrid8.gemspec +1 -1
- data/lib/h8/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d638cb92726ca7b7e5cf94306a606c428b7aa7d1
|
4
|
+
data.tar.gz: be70554d03f25f31871996b9db620554ff3e24e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a31f32aa2c9c13a557908cba8153a2da1d4b3389f234d28ecc56883642df838669b07fab2fcad0f55cd7d5210f244bea2629134f27099e42a58d913970fe2044
|
7
|
+
data.tar.gz: 08ae8c723f45d2a3382edeac01e06c124c1bde60d2ae9bfb53032578fd21611e2620b9502a62b78a26d351d22132a6f66d670fdc8c74a96ddf4477a063cb4779
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -10,15 +10,15 @@ in 8-core you can create 8 H8::Contexts and run them truly in parallel.
|
|
10
10
|
|
11
11
|
This gem was intended to replace therubyracer for many reasons:
|
12
12
|
|
13
|
-
* therubyracer
|
14
|
-
numerous frequent crashes.
|
13
|
+
* therubyracer had critical bugs (that was hte reason for this) that are not fixed for a long time,
|
14
|
+
under load it produces numerous frequent random crashes.
|
15
15
|
|
16
|
-
* therubyracer still uses antique version of V8, H8 uses the latest 3.31 branch, which
|
17
|
-
|
16
|
+
* therubyracer still uses antique version of V8, H8 uses the latest 3.31 branch, which has manu
|
17
|
+
improvements, harmony support and so on.
|
18
18
|
|
19
|
-
* H8 is designed to provide
|
20
|
-
|
21
|
-
|
19
|
+
* H8 is designed to provide tight and integration of two allocation systems and object models,
|
20
|
+
passing the same objects between different systems wrapping and unwrapping them rather than copying
|
21
|
+
and changing them.
|
22
22
|
|
23
23
|
* We hope that by the cost non significant changes we will provide faster execution. And might v8
|
24
24
|
modern branch will help us with it ;)
|
@@ -48,12 +48,12 @@ in separate threads.
|
|
48
48
|
|
49
49
|
Due to v8 and ruby MRI limitations, only one ruby thread can access any given H8::Context (e.g.
|
50
50
|
execute javascript code in it), and, as usual, all ruby threads are locked by a single mitex (gvl).
|
51
|
-
Still, having multiple H8::Context in different ruby threads let you run java/coffee scripts in
|
52
|
-
parallel - what you can not have with pure MRI ruby
|
51
|
+
Still, having multiple H8::Context in different ruby threads let you run many java/coffee scripts in
|
52
|
+
parallel with a single ruby thread - what you can not have with pure MRI ruby.
|
53
53
|
|
54
54
|
## Main difference from therubyracer/features not ready
|
55
55
|
|
56
|
-
-
|
56
|
+
- lambda/proc passed as var to the context **does not receives first (this) argument
|
57
57
|
automatically!**
|
58
58
|
|
59
59
|
E.g. rubyracer code
|
@@ -43,6 +43,18 @@ class Solver
|
|
43
43
|
res.push ( (if x==0 then ' .' else pad(x,3)) for x in @desk[r]).join('')
|
44
44
|
res.join "\n"
|
45
45
|
|
46
|
-
|
47
|
-
new
|
46
|
+
timing = (name, cb) ->
|
47
|
+
start = new Date().getTime()
|
48
|
+
res = cb()
|
49
|
+
console.log("#{name}: #{(new Date().getTime() - start)/1000}")
|
50
|
+
res
|
51
|
+
|
52
|
+
result = timing 'KN h8', ->
|
53
|
+
new Solver(7, 3).toString()
|
54
|
+
console.log result
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
# return (n, left) ->
|
59
|
+
# new Solver(n, left).toString()
|
48
60
|
|
data/benchmark/knigthsmove.rb
CHANGED
data/hybrid8.gemspec
CHANGED
@@ -34,7 +34,7 @@ spec = Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_development_dependency "rake-compiler"
|
35
35
|
spec.add_development_dependency "rspec", '~> 3.1'
|
36
36
|
|
37
|
-
spec.add_dependency 'pargser'
|
37
|
+
spec.add_dependency 'pargser', '>= 0.1.2'
|
38
38
|
end
|
39
39
|
|
40
40
|
Gem::PackageTask.new(spec) do |pkg|
|
data/lib/h8/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: h8
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sergeych
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.1.2
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.1.2
|
83
83
|
description: |2
|
84
84
|
Synergy of ruby and javascript code, almost completely integrates both languages, their
|
85
85
|
garbage collection models, object models and so on. Effective for tight ruby-javascript
|