nl-fast_png 0.0.0.pre.usegit → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +6 -8
- data/bin/benchmark.rb +27 -0
- data/lib/nl/fast_png/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a664f29a95a13c1a1ef044bf45275359d44cb7e16104962b5b4d807ae2350c8e
|
4
|
+
data.tar.gz: 1ce7b4c9f10da315e2841e619a6e498774ed71df008b3104143636c27c643ef4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dce949b32465706dece2e020664125a3c38f4f50e678a21548741565f40d513164c32c1c1c3321fbb7fa1113cee96127c54037cc3dbdbc6d62a01167b0843ce7
|
7
|
+
data.tar.gz: a1e7749d4a4fd39d6c640959cd952e32deb10712bca926e335d822f0a38b1c84d52d2f9952303450ed9ca6cebee35af4f5bfd4da64c04904e78a0229c7ec0cc4
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# NL::
|
1
|
+
# NL::FastPng
|
2
2
|
|
3
3
|
NL::FastPng is a C-based extension that uses libpng in a simplified
|
4
|
-
configuration for faster performance on
|
4
|
+
configuration for faster performance on grayscale images, at the expense
|
5
5
|
of slightly larger file sizes.
|
6
6
|
|
7
7
|
This code was used by the Nitrogen Logic Depth Camera Controller to generate
|
@@ -17,16 +17,14 @@ details. NL::FastPng is © 2011-2020, Mike Bourgeous.
|
|
17
17
|
Add this line to your application's Gemfile:
|
18
18
|
|
19
19
|
```ruby
|
20
|
-
gem 'nl-fast_png'
|
20
|
+
gem 'nl-fast_png', git: 'git@github.com:nitrogenlogic/nl-fast_png.git'
|
21
21
|
```
|
22
22
|
|
23
23
|
And then execute:
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
$ gem install nl-fast_png
|
25
|
+
```bash
|
26
|
+
$ bundle install
|
27
|
+
```
|
30
28
|
|
31
29
|
## Usage
|
32
30
|
|
data/bin/benchmark.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler/setup'
|
5
|
+
|
6
|
+
require 'benchmark'
|
7
|
+
|
8
|
+
require 'nl/fast_png'
|
9
|
+
|
10
|
+
THREADS=ENV['THREADS']&.to_i || 8
|
11
|
+
COUNT=ENV['COUNT']&.to_i || 1000
|
12
|
+
|
13
|
+
elapsed = Benchmark.realtime do
|
14
|
+
threads = THREADS.times.map {
|
15
|
+
Thread.new do
|
16
|
+
data = 256.times.map(&:chr).join * 1024
|
17
|
+
COUNT.times do
|
18
|
+
NL::FastPng.store_png(512, 512, 8, data)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
}
|
22
|
+
|
23
|
+
threads.each(&:join)
|
24
|
+
end
|
25
|
+
|
26
|
+
puts "Elapsed: #{elapsed} seconds"
|
27
|
+
puts "Speed: #{(THREADS * COUNT) / elapsed} per second"
|
data/lib/nl/fast_png/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nl-fast_png
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Bourgeous
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- LICENSE
|
53
53
|
- README.md
|
54
54
|
- Rakefile
|
55
|
+
- bin/benchmark.rb
|
55
56
|
- bin/console
|
56
57
|
- bin/setup
|
57
58
|
- ext/nl-fast_png/extconf.rb
|
@@ -75,9 +76,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
76
|
version: 2.3.0
|
76
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
78
|
requirements:
|
78
|
-
- - "
|
79
|
+
- - ">="
|
79
80
|
- !ruby/object:Gem::Version
|
80
|
-
version:
|
81
|
+
version: '0'
|
81
82
|
requirements: []
|
82
83
|
rubygems_version: 3.1.4
|
83
84
|
signing_key:
|