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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88204ca9277cf3c8d3c16fe73de7988edf525d2a
4
- data.tar.gz: 4a98cb3182984b7e24203a4a062935ed15845ce4
3
+ metadata.gz: 22eec06727bd469b0ad0b944d080cacc680f09e3
4
+ data.tar.gz: b43145ea1e3bafdba49d2c9f92aaa4213bcae121
5
5
  SHA512:
6
- metadata.gz: ab145aa231671488f79a0263873b14a0a1a7fa43f5e499000db8aae8b414549f659215ffea4a5361f45fea3b9185c44365f9aa4808e7e219bac3f2c467be2c37
7
- data.tar.gz: 778dd3860788bb46f48db10eda511e1271f09d59a80b4cb87e07930d1bed2c41f3c31bc4a6a3accc2b4f2f5083a40a0e7602bb03124449dab5a9e80e4ea39e52
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 # => 1
60
- Duffy::System.cores # => 2
61
- Duffy::System.threads # => 4
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
@@ -1,3 +1,3 @@
1
1
  module Duffy
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.9
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-06 00:00:00.000000000 Z
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.3
134
+ rubygems_version: 2.4.6
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Library of things