[Groonga-commit] groonga/benchmarks at 42a3d8d [master] Load data one by one

Back to archive index

Hiroshi Hatake null+****@clear*****
Fri Jan 9 18:58:24 JST 2015


Hiroshi Hatake	2015-01-09 18:58:24 +0900 (Fri, 09 Jan 2015)

  New Revision: 42a3d8dd46a296ab6395bade4994be028fbd6626
  https://github.com/groonga/benchmarks/commit/42a3d8dd46a296ab6395bade4994be028fbd6626

  Message:
    Load data one by one

  Modified files:
    bench_reference_vector.rb

  Modified: bench_reference_vector.rb (+4 -8)
===================================================================
--- bench_reference_vector.rb    2015-01-09 18:30:46 +0900 (9504c5f)
+++ bench_reference_vector.rb    2015-01-09 18:58:24 +0900 (a70f6c9)
@@ -43,15 +43,16 @@ def create_table
 table_create Tags TABLE_HASH_KEY ShortText
 table_create Articles TABLE_HASH_KEY ShortText
 column_create Articles tags COLUMN_VECTOR Tags
-load --table Articles
-[
 EOH
 end
 
 def load_data(num_loop, dirname, print_frequency)
   num_loop.times.each do |i|
-    print(<<-EOH.strip)
+    puts(<<-EOH.strip)
+load --table Articles
+[
 {"_key": "http://groonga.org/#{i}", "tags": "#{article_tags}"},
+]
 EOH
     if (i % print_frequency) == 0
       get_dir_size(dirname, i)
@@ -59,13 +60,8 @@ EOH
   end
 end
 
-def eof_data
-  print("]")
-end
-
 target_records_size = 100000
 print_frequency = target_records_size / 10
 create_table
 load_data(target_records_size, "db", print_frequency)
-eof_data
 get_dir_size("db", target_records_size)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index