duffy 0.1.9 → 0.2.0
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 +4 -4
- data/README.md +4 -3
- data/lib/duffy/system.rb +6 -0
- data/lib/duffy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22eec06727bd469b0ad0b944d080cacc680f09e3
|
4
|
+
data.tar.gz: b43145ea1e3bafdba49d2c9f92aaa4213bcae121
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7d373ba7aa6d42ce1d7672fc8852a8033df5e9c0bb78ff5ab8aaa0711cf393afcca613f036b380bf88f7713e95312c42ec15dc2462d2b7a00b6094167712f5c
|
7
|
+
data.tar.gz: 3d9d7c798a62c37357f5d6171b68d83a25696dd6c59c6b57f85cadb248105f6a4cf0511c65cfee5f607b9a759846390441d9a55b18f403f1064b8b270ecfee67
|
data/README.md
CHANGED
@@ -56,9 +56,10 @@ CPU Detection:
|
|
56
56
|
Linux and Mac only for now, each method returns 1 on unsupported hosts.
|
57
57
|
Example results for my dual core i5 with hyperthreading.
|
58
58
|
```ruby
|
59
|
-
Duffy::System.cpus
|
60
|
-
Duffy::System.cores
|
61
|
-
Duffy::System.threads
|
59
|
+
Duffy::System.cpus # => 1
|
60
|
+
Duffy::System.cores # => 2
|
61
|
+
Duffy::System.threads # => 4
|
62
|
+
Duffy::System.sane_load # => 3
|
62
63
|
```
|
63
64
|
|
64
65
|
|
data/lib/duffy/system.rb
CHANGED
@@ -39,6 +39,12 @@ module Duffy
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
# What is a sane number of threads to use for data processing.
|
43
|
+
# Only using true cores is a waste, using all pseudo cores decreases performance.
|
44
|
+
def sane_load
|
45
|
+
(cores + threads) / 2
|
46
|
+
end
|
47
|
+
|
42
48
|
end
|
43
49
|
end
|
44
50
|
end
|
data/lib/duffy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duffy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Duffy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
133
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.4.
|
134
|
+
rubygems_version: 2.4.6
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Library of things
|