niceql 0.1.23 → 0.1.24

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
  SHA256:
3
- metadata.gz: 1dfcafe0d0be8d92b64b06342910568796ddc264a914a930e8bd183ace83f1e9
4
- data.tar.gz: 19b896ec5e2e36c637f3bd7cff237cfff26581c211702d640e7fcd5a782832a9
3
+ metadata.gz: ec80b35674703f65be9841e1596065cb395f71d31eca1704e40648390de88b6c
4
+ data.tar.gz: b59ca0d932ef22245dc040425260a050441ac69789cb97284983f07e71088bf2
5
5
  SHA512:
6
- metadata.gz: e801df8dd07905db21ff697b7961a10d80a67895ad1f5cf991e68f11e24fc1942fa9d7a196a3a9a30cb4b992d002a38daef19deb1e235c7f5baeadd72e167065
7
- data.tar.gz: 3b4e129aa6a0b49178c809239feb346a454e50da6cd8d930a4b465b16a29078ae23df99d14c9b90536671c3475af9e31f3f24de7535626ac4919f03bbe4cddd3
6
+ metadata.gz: c87708d4886737e56558278e958563292cc0dbb955d204ed38ff0c6e8f9f8797bebf1ef67caf531e13f80e70b7f9f762e147f19f762aa8e1f7b9e8cd5c80912f
7
+ data.tar.gz: 98fc43d968e68143940722d341f828316313b3f614785024a0203ea5e294df4c1c3b3ff4494d207353690ec43b27c64680eee7b71789286257a21bddd4fc44b0
data/.travis.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.4
5
- - 2.5.1
6
- - 2.3.7
4
+ - 2.4
5
+ - 2.5
6
+ - 2.3
7
+ - 2.2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.1.24
2
+
3
+ * No features, just strict ruby dependency for >= 2.3 and travis fix for ruby 2.3
4
+
1
5
  # 0.1.23
2
6
  * +LATERAL verb
3
7
  * removed hidden rails dependencies PR(https://github.com/alekseyl/niceql/pull/9)
data/lib/benchmark/cat.rb CHANGED
@@ -1,80 +1,34 @@
1
1
  require 'benchmark/ips'
2
2
 
3
- $str = File.open( './txt' ).readlines.join(' ')
4
-
5
- def str_gen( size, rand_size )
6
- $str[ rand(50000), size + rand(rand_size) ]
7
- end
8
-
9
- def chunk_gen( size )
10
- $str[ rand(50000), size ]
11
- end
12
-
13
3
  # 2 + 1 = 3 object
14
- def slow_plus(size, rand_size )
15
- str_gen(size, rand_size ) + str_gen(size, rand_size )
4
+ def slow_plus
5
+ 'foo' + 'bar'
16
6
  end
17
7
 
18
8
  # 2 + 1 = 3 object
19
- def slow_concat(size, rand_size)
20
- str_gen(size, rand_size ).concat str_gen(size, rand_size )
9
+ def slow_concat
10
+ 'foo'.concat 'bar'
21
11
  end
22
12
 
23
13
  # 2 + 1 = 3 object
24
- def slow_append(size, rand_size)
25
- str_gen(size, rand_size ) << str_gen(size, rand_size )
14
+ def slow_append
15
+ 'foo' << 'bar'
26
16
  end
27
17
 
28
- def fast_interpolation(size, rand_size)
29
- "#{str_gen(size, rand_size )}#{str_gen(size, rand_size )}"
18
+ # 1 object
19
+ def fast
20
+ 'foo' 'bar'
30
21
  end
31
22
 
32
-
33
-
34
- def test_concat(size, rand_size, chunk_size = 1)
35
- Benchmark.ips do |x|
36
- x.report('String#+') { slow_plus(size, rand_size) }
37
- x.report('String#concat') { slow_concat(size, rand_size) }
38
- x.report('String#append') { slow_append(size, rand_size) }
39
- x.report('"#{\'foo\'}#{\'bar\'}"') { fast_interpolation(size, rand_size) }
40
- x.compare!
41
- end
42
-
43
- # Benchmark.ips do |x|
44
- # puts '------------------------------+ chunk----------------'
45
- # x.report('String#+') { str_gen(size, rand_size ) + chunk_gen(chunk_size) }
46
- # x.report('String#concat') { str_gen(size, rand_size ).concat chunk_gen(chunk_size) }
47
- # x.report('String#append') { str_gen(size, rand_size ) << chunk_gen(chunk_size) }
48
- # x.report('"#{\'foo\'}#{\'bar\'}"') { "#{str_gen(size, rand_size )}#{chunk_gen(chunk_size)}" }
49
- # x.compare!
50
- # end
51
- #
52
- # Benchmark.ips do |x|
53
- # puts '------------------------------chunk +----------------'
54
- # x.report('String#+') { str_gen(size, rand_size ) + chunk_gen(chunk_size) }
55
- # x.report('String#concat') { str_gen(size, rand_size ).concat chunk_gen(chunk_size) }
56
- # x.report('String#append') { str_gen(size, rand_size ) << chunk_gen(chunk_size) }
57
- # x.report('"#{\'foo\'}#{\'bar\'}"') { "#{str_gen(size, rand_size )}#{chunk_gen(chunk_size)}" }
58
- # x.compare!
59
- # end
60
-
61
-
62
- Benchmark.ips do |x|
63
- puts '------------------------------triple spaced----------------'
64
- x.report('String#+') { str_gen(size, rand_size ) + ' '+ str_gen(size, rand_size) }
65
- x.report('String#concat') { str_gen(size, rand_size ).concat(' ').concat( str_gen(size, rand_size ) )}
66
- x.report('String#append') { str_gen(size, rand_size ) << ' ' << str_gen(size, rand_size ) }
67
- x.report('"#{\'foo\'}#{\'bar\'}"') { "#{str_gen(size, rand_size )} #{chunk_gen(chunk_size)}" }
68
- x.compare!
69
- end
70
-
71
-
72
- Benchmark.ips do |x|
73
- puts '------------------------------triple spaced----------------'
74
- x.report('String#+') { str_gen(size, rand_size ) + str_gen(size, rand_size ) + str_gen(size, rand_size) }
75
- x.report('String#concat') { str_gen(size, rand_size ).concat(str_gen(size, rand_size )).concat( str_gen(size, rand_size ) )}
76
- x.report('String#append') { str_gen(size, rand_size ) << str_gen(size, rand_size ) << str_gen(size, rand_size ) }
77
- x.report('"#{\'foo\'}#{\'bar\'}"') { "#{str_gen(size, rand_size )}#{str_gen(size, rand_size )}#{chunk_gen(chunk_size)}" }
78
- x.compare!
79
- end
23
+ def fast_interpolation
24
+ "#{'foo'}#{'bar'}"
80
25
  end
26
+
27
+ Benchmark.ips do |x|
28
+ x.report('String#+') { slow_plus }
29
+ x.report('String#concat') { slow_concat }
30
+ x.report('String#append') { slow_append }
31
+ x.report('"foo" "bar"') { fast }
32
+ x.report('"#{\'foo\'}#{\'bar\'}"') { fast_interpolation }
33
+ x.compare!
34
+ end
@@ -1,25 +1,34 @@
1
1
  require 'benchmark/ips'
2
2
 
3
- $str = File.open( './txt' ).readlines.join(' ')
4
-
5
3
  # 2 + 1 = 3 object
6
- def _gsub(str)
7
- str.gsub( /\s+/, '' )
4
+ def slow_plus
5
+ 'foo' + 'bar'
8
6
  end
9
7
 
10
8
  # 2 + 1 = 3 object
11
- def _gsub!(str)
12
- str.gsub!( /\s+/, '' )
9
+ def slow_concat
10
+ 'foo'.concat 'bar'
13
11
  end
14
12
 
13
+ # 2 + 1 = 3 object
14
+ def slow_append
15
+ 'foo' << 'bar'
16
+ end
15
17
 
16
- def test_gsubs( word_count, string_count = 1000 )
17
- arr = Array.new( string_count ) { $str.split.sample(word_count).join(' ') }
18
-
19
- Benchmark.ips do |x|
18
+ # 1 object
19
+ def fast
20
+ 'foo' 'bar'
21
+ end
20
22
 
21
- x.report('_gsub!') { arr.each{ |str| _gsub!(str) } }
22
- x.report('_gsub') { arr.each{ |str| _gsub(str) } }
23
- x.compare!
24
- end
23
+ def fast_interpolation
24
+ "#{'foo'}#{'bar'}"
25
25
  end
26
+
27
+ Benchmark.ips do |x|
28
+ x.report('String#+') { slow_plus }
29
+ x.report('String#concat') { slow_concat }
30
+ x.report('String#append') { slow_append }
31
+ x.report('"foo" "bar"') { fast }
32
+ x.report('"#{\'foo\'}#{\'bar\'}"') { fast_interpolation }
33
+ x.compare!
34
+ end