Skip to content

Instantly share code, notes, and snippets.

View BanzaiMan's full-sized avatar

Hiro Asari BanzaiMan

View GitHub Profile
@BanzaiMan
BanzaiMan / gist:148859
Created July 17, 2009 03:59
JRuby: sqlite3-ffi tc_integration output scratch pad
surfboard:sqlite3-ruby-ffi asari$ SQLITE3_DRIVERS=FFI jruby -v -rubygems -I test test/tc_integration.rb
jruby 1.4.0dev (ruby 1.8.6p287) (2009-07-10 6586) (Java HotSpot(TM) Client VM 1.5.0_19) [i386-java]
Loaded suite test/tc_integration
Started
....F......FFFFF..F...........................F..................trace is an experimental feature of SQLite3
E.....................................................
Finished in 2.504 seconds.
1) Failure:
test_busy_handler_outwait(Integration::TC_Database_FFI) [test/tc_integration.rb:561]:
@BanzaiMan
BanzaiMan / gist:148864
Created July 17, 2009 04:08
MRI: sqlite3-ffi tc_integration output scratch pad
surfboard:sqlite3-ruby-ffi asari$ SQLITE3_DRIVERS=FFI ruby -v -rubygems -I test test/tc_integration.rb
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
Loaded suite test/tc_integration
Started
/Library/Ruby/Gems/1.8/gems/ffi-0.3.5/lib/ffi/struct.rb:24: warning: method redefined; discarding old offset
./test/../lib/sqlite3/driver/ffi/driver.rb:179: warning: method redefined; discarding old aggregate_count
FEE.........EEEEE..F.........EE................F..............EFE.trace is an experimental feature of SQLite3
E.E..E...............E.................EE..........F.E
Finished in 1.662956 seconds.
@BanzaiMan
BanzaiMan / gist:148867
Created July 17, 2009 04:11
JRuby: sqlite3-ffi driver/ffi/tc_driver output scratch pad
surfboard:sqlite3-ruby-ffi asari$ SQLITE3_DRIVERS=FFI jruby -v -rubygems -I lib -I test test/driver/ffi/tc_driver.rb
jruby 1.4.0dev (ruby 1.8.6p287) (2009-07-10 6586) (Java HotSpot(TM) Client VM 1.5.0_19) [i386-java]
Loaded suite test/driver/ffi/tc_driver
Started
............F....F....
Finished in 0.181 seconds.
1) Failure:
test_errmsg16(TC_FFI_Driver) [test/driver/ffi/tc_driver.rb:58]:
<"\376\377\000n\000o\000t\000 \000a\000n\000 \000e\000r\000r\000o\000r"> expected but was
@BanzaiMan
BanzaiMan / gist:148871
Created July 17, 2009 04:14
MRI: sqlite3-ffi driver/ffi/tc_driver.rb output scratch pad
surfboard:sqlite3-ruby-ffi asari$ SQLITE3_DRIVERS=FFI ruby -v -rubygems -I lib -I test test/driver/ffi/tc_driver.rb
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
/Library/Ruby/Gems/1.8/gems/ffi-0.3.5/lib/ffi/struct.rb:24: warning: method redefined; discarding old offset
Loaded suite test/driver/ffi/tc_driver
Started
.........F..F....F....
Finished in 0.127089 seconds.
1) Failure:
test_complete16(TC_FFI_Driver) [test/driver/ffi/tc_driver.rb:113]:
@BanzaiMan
BanzaiMan / gist:149366
Created July 18, 2009 01:06
sqlite3 benchmarking with C, DL, and FFI drivers
surfboard:sqlite3-ruby-ffi asari$ git log --pretty=oneline -1
3c89051443842b46f37d48914db5d66c05965719 allow column_decltype to get utf16 parameter avoid duplicate of sqlite3_step symbol first pass at value_blob, value_text and column_blob. more simplistic view of create_function.
surfboard:sqlite3-ruby-ffi asari$ ruby -v -rubygems -I lib -I ext -I test test/native-vs-dl-vs-ffi.rb
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
database creation...
user system total real
dl 0.180000 0.160000 0.340000 ( 0.351612)
native 0.130000 0.160000 0.290000 ( 0.293039)
ffi 0.190000 0.170000 0.360000 ( 0.364955)
$ newgem testgem
create
create lib/testgem
create script
create History.txt
create Rakefile
create README.rdoc
create PostInstall.txt
create lib/testgem.rb
dependency install_test_unit
@BanzaiMan
BanzaiMan / -J-Djruby.backtrace.style=raw
Created July 27, 2009 05:32
JRuby and autotest conspire to produce IOError
Thread.java:1409:in `getStackTrace': closed stream (IOError)
from RubyException.java:139:in `setBacktraceFrames'
from RaiseException.java:160:in `setException'
from RaiseException.java:72:in `<init>'
from Ruby.java:3031:in `newRaiseException'
from Ruby.java:2975:in `newIOError'
from OpenFile.java:151:in `checkClosed'
from RubyIO.java:304:in `getOpenFileChecked'
from RubyIO.java:353:in `getInStream'
from IOInputStream.java:65:in `<init>'
surfboard:~ asari$ rm -rf .multiruby/
surfboard:~ asari$ jruby -S multiruby_setup jruby:git:current jruby:tar:1.3.1 rbx:git:current mri:tar:1.8.7
creating /Users/asari/.multiruby
creating build
creating install
creating versions
creating tmp
Running command: git clone git://github.com/jruby/jruby.git jruby
Initialize jruby/.git
remote: Counting objects: 110862, done.
require 'irb'
module IRB
def self.start_session(binding)
IRB.setup(nil)
workspace = WorkSpace.new(binding)
if @CONF[:SCRIPT]
irb = Irb.new(workspace, @CONF[:SCRIPT])
surfboard:~ asari$ ruby -ve 'puts Time.now.strftime("%a %b %c %d %e %f %g %h %i %j %k %l %m %n %o %p %q %r %s %t %u %v %w %x %y %z\n%A %B %C %D %E %F %G %H %I %J %K %L %M %N %O %P %Q %R %S %T %U %V %W %X %Y %Z")'
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
Tue Aug Tue Aug 11 00:12:36 2009 11 11 f 09 Aug i 223 0 12 08
o AM q 12:12:36 AM 1249967556 2 11-Aug-2009 2 08/11/09 09 -0500
Tuesday August 20 08/11/09 2009-08-11 2009 00 12 J K L 12 N P Q 00:12 36 00:12:36 32 33 32 00:12:36 2009 CDT
surfboard:~ asari$ ruby19 -ve 'puts Time.now.strftime("%a %b %c %d %e %f %g %h %i %j %k %l %m %n %o %p %q %r %s %t %u %v %w %x %y %z\n%A %B %C %D %E %F %G %H %I %J %K %L %M %N %O %P %Q %R %S %T %U %V %W %X %Y %Z")'
ruby 1.9.2dev (2009-07-31 trunk 24332) [i386-darwin9.7.0]
Tue Aug Tue Aug 11 00:12:38 2009 11 11 %f 09 Aug %i 223 0 12 08
%o AM %q 12:12:38 AM 1249967558 2 11-AUG-2009 2 08/11/09 09 -0500
Tuesday August 20 08/11/09 %E 2009-08-11 2009 00 12 %J %K 149 12 149564000 %O am %Q 00:12 38 00:12:3