Forum: IronRuby IR WPF Project, ActiveRecord sqlite3-ironruby writes slow, reads fast

Posted by Sick Boy (Guest)
on 2011-01-06 17:19
(Received via mailing list)
Hello,
I am since some weeks working with IronRuby.I do not consider myself a 
great programmer in neither Ruby or .NET, yet I really love Ruby, and in 
these past few weeks IronRuby and .NET in general has really grown on 
me; very powerful!So first; my gratitude for this amazing product, 
thanks to all who make this possible!
My project's available @ Github: 
https://github.com/sickboy/six-updater-gui
My current issue is that SQLite writes seem to take at least 0.7 seconds 
per write.So if I update 100 records at once in 1 query, it will take 
~0.8s.But also if I update 1 record, it will take ~0.7s..In comparison, 
the same actions with mingw Ruby 1.9.2 (from RubyInstaller.org), these 
writes take only about 0.005s
Reads seem to be okay.
Is this a known problem? Is there anything that can be done about 
this?Do others see these long delays as well? How about msSQL 
(/Express)?

Not sure if I should create a seperate mail thread for this;The second 
problem i'm having is that when I load a database model with 
ActiveRecord 2.3.8 into a BindingList, and that to a BindingSource, and 
assign it to a DataGridView, everything is fine.When I use ActiveRecord 
3.03, I get "A singleton class has no underlying system type". Unless I 
don't add records to the binding list, before assigning the 
BindingSource as data_source of the DataGridView, and instead, add 
records to the binding list after assigning the data_source.I am not 
sure how I should debug this problem.

Lastly I have the feeling (based on timing results in my logs) that 
processing IronRuby scripts is faster when they run through the ir.exe 
interpreter, than when they are executed in an engine from within a c# 
app.Could that be because certain optimizations are enabled in ir.exe, 
or something similair?

Thanks for your time!
Posted by Sick Boy (Guest)
on 2011-01-08 13:03
(Received via mailing list)
I went out of my way and decided to have a look at updating the SQlite 
dll.
It seems the interface has changed since sqlite3-ironruby gem release.
I have downloaded and put the Community.CsharpSqlite.dll in the native 
folder:http://code.google.com/p/csharp-sqlite/downloads/l...
Then I have adjusted driver.rb to: 
http://pastebin.com/diff.php?i=7e522Rvs
Most things seem to just work, and it's blazing fast now, about as fast 
as Ruby 1.9.2's sqlite3 performance!
I thought i'd let you know in case experiencing similair issues :-)

From: sb@dev-heaven.net
To: ironruby-core@rubyforge.org
Date: Thu, 6 Jan 2011 15:51:46 +0000
Subject: [Ironruby-core] IR WPF Project, ActiveRecord sqlite3-ironruby 
writes slow, reads fast








Hello,
I am since some weeks working with IronRuby.I do not consider myself a 
great programmer in neither Ruby or .NET, yet I really love Ruby, and in 
these past few weeks IronRuby and .NET in general has really grown on 
me; very powerful!So first; my gratitude for this amazing product, 
thanks to all who make this possible!
My project's available @ Github: 
https://github.com/sickboy/six-updater-gui
My current issue is that SQLite writes seem to take at least 0.7 seconds 
per write.So if I update 100 records at once in 1 query, it will take 
~0.8s.But also if I update 1 record, it will take ~0.7s..In comparison, 
the same actions with mingw Ruby 1.9.2 (from RubyInstaller.org), these 
writes take only about 0.005s
Reads seem to be okay.
Is this a known problem? Is there anything that can be done about 
this?Do others see these long delays as well? How about msSQL 
(/Express)?

Not sure if I should create a seperate mail thread for this;The second 
problem i'm having is that when I load a database model with 
ActiveRecord 2.3.8 into a BindingList, and that to a BindingSource, and 
assign it to a DataGridView, everything is fine.When I use ActiveRecord 
3.03, I get "A singleton class has no underlying system type". Unless I 
don't add records to the binding list, before assigning the 
BindingSource as data_source of the DataGridView, and instead, add 
records to the binding list after assigning the data_source.I am not 
sure how I should debug this problem.

Lastly I have the feeling (based on timing results in my logs) that 
processing IronRuby scripts is faster when they run through the ir.exe 
interpreter, than when they are executed in an engine from within a c# 
app.Could that be because certain optimizations are enabled in ir.exe, 
or something similair?

Thanks for your time!
Posted by Sick Boy (Guest)
on 2011-01-09 01:21
(Received via mailing list)
Only problem i've ran into with this method for now has been the usage 
of System::Int64 for Primary keys.
In a join table it was storing the yaml representation of the Int64 
object instead of the proper Integer value,
as a quick patch I've applied the following but i'm sure there is a 
better safer way;
class System::Int64
 def to_i; self.to_s.to_i; end
end

From: sb@dev-heaven.net
To: ironruby-core@rubyforge.org
Date: Sat, 8 Jan 2011 11:53:05 +0000
Subject: Re: [Ironruby-core] IR WPF Project, ActiveRecord 
sqlite3-ironruby writes slow, reads fast








I went out of my way and decided to have a look at updating the SQlite 
dll.
It seems the interface has changed since sqlite3-ironruby gem release.
I have downloaded and put the Community.CsharpSqlite.dll in the native 
folder:http://code.google.com/p/csharp-sqlite/downloads/l...
Then I have adjusted driver.rb to: 
http://pastebin.com/diff.php?i=7e522Rvs
Most things seem to just work, and it's blazing fast now, about as fast 
as Ruby 1.9.2's sqlite3 performance!
I thought i'd let you know in case experiencing similair issues :-)

From: sb@dev-heaven.net
To: ironruby-core@rubyforge.org
Date: Thu, 6 Jan 2011 15:51:46 +0000
Subject: [Ironruby-core] IR WPF Project, ActiveRecord sqlite3-ironruby 
writes slow, reads fast








Hello,
I am since some weeks working with IronRuby.I do not consider myself a 
great programmer in neither Ruby or .NET, yet I really love Ruby, and in 
these past few weeks IronRuby and .NET in general has really grown on 
me; very powerful!So first; my gratitude for this amazing product, 
thanks to all who make this possible!
My project's available @ Github: 
https://github.com/sickboy/six-updater-gui
My current issue is that SQLite writes seem to take at least 0.7 seconds 
per write.So if I update 100 records at once in 1 query, it will take 
~0.8s.But also if I update 1 record, it will take ~0.7s..In comparison, 
the same actions with mingw Ruby 1.9.2 (from RubyInstaller.org), these 
writes take only about 0.005s
Reads seem to be okay.
Is this a known problem? Is there anything that can be done about 
this?Do others see these long delays as well? How about msSQL 
(/Express)?

Not sure if I should create a seperate mail thread for this;The second 
problem i'm having is that when I load a database model with 
ActiveRecord 2.3.8 into a BindingList, and that to a BindingSource, and 
assign it to a DataGridView, everything is fine.When I use ActiveRecord 
3.03, I get "A singleton class has no underlying system type". Unless I 
don't add records to the binding list, before assigning the 
BindingSource as data_source of the DataGridView, and instead, add 
records to the binding list after assigning the data_source.I am not 
sure how I should debug this problem.

Lastly I have the feeling (based on timing results in my logs) that 
processing IronRuby scripts is faster when they run through the ir.exe 
interpreter, than when they are executed in an engine from within a c# 
app.Could that be because certain optimizations are enabled in ir.exe, 
or something similair?

Thanks for your time!

_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core
Posted by Tomas Matousek (Guest)
on 2011-01-09 01:47
(Received via mailing list)
The driver should convert Int64 to Bignum, using e.g. Kernel#Integer:

>>> i64 = System::Int64.new(1000000000000)
=> 1000000000000 (Int64)
>>> Integer(i64)
=> 1000000000000
>>> Integer(i64).class
=> Bignum
>>>

Tomas

From: ironruby-core-bounces@rubyforge.org 
[mailto:ironruby-core-bounces@rubyforge.org] On Behalf Of Sick Boy
Sent: Saturday, January 08, 2011 3:58 PM
To: ironruby-core@rubyforge.org
Subject: Re: [Ironruby-core] IR WPF Project, ActiveRecord 
sqlite3-ironruby writes slow, reads fast

Only problem i've ran into with this method for now has been the usage 
of System::Int64 for Primary keys.

In a join table it was storing the yaml representation of the Int64 
object instead of the proper Integer value,

as a quick patch I've applied the following but i'm sure there is a 
better safer way;

class System::Int64

 def to_i; self.to_s.to_i; end

end


________________________________
From: sb@dev-heaven.net
To: ironruby-core@rubyforge.org
Date: Sat, 8 Jan 2011 11:53:05 +0000
Subject: Re: [Ironruby-core] IR WPF Project, ActiveRecord 
sqlite3-ironruby writes slow, reads fast

I went out of my way and decided to have a look at updating the SQlite 
dll.

It seems the interface has changed since sqlite3-ironruby gem release.

I have downloaded and put the Community.CsharpSqlite.dll in the native 
folder:
http://code.google.com/p/csharp-sqlite/downloads/l...

Then I have adjusted driver.rb to: 
http://pastebin.com/diff.php?i=7e522Rvs

Most things seem to just work, and it's blazing fast now, about as fast 
as Ruby 1.9.2's sqlite3 performance!

I thought i'd let you know in case experiencing similair issues :-)
________________________________
From: sb@dev-heaven.net
To: ironruby-core@rubyforge.org
Date: Thu, 6 Jan 2011 15:51:46 +0000
Subject: [Ironruby-core] IR WPF Project, ActiveRecord sqlite3-ironruby 
writes slow, reads fast
Hello,

I am since some weeks working with IronRuby.
I do not consider myself a great programmer in neither Ruby or .NET, yet 
I really love Ruby, and in these past few weeks IronRuby and .NET in 
general has really grown on me; very powerful!
So first; my gratitude for this amazing product, thanks to all who make 
this possible!

My project's available @ Github: 
https://github.com/sickboy/six-updater-gui

My current issue is that SQLite writes seem to take at least 0.7 seconds 
per write.
So if I update 100 records at once in 1 query, it will take ~0.8s.
But also if I update 1 record, it will take ~0.7s..
In comparison, the same actions with mingw Ruby 1.9.2 (from 
RubyInstaller.org), these writes take only about 0.005s

Reads seem to be okay.

Is this a known problem? Is there anything that can be done about this?
Do others see these long delays as well? How about msSQL (/Express)?


Not sure if I should create a seperate mail thread for this;
The second problem i'm having is that when I load a database model with 
ActiveRecord 2.3.8 into a BindingList, and that to a BindingSource, and 
assign it to a DataGridView, everything is fine.
When I use ActiveRecord 3.03, I get "A singleton class has no underlying 
system type". Unless I don't add records to the binding list, before 
assigning the BindingSource as data_source of the DataGridView, and 
instead, add records to the binding list after assigning the 
data_source.
I am not sure how I should debug this problem.


Lastly I have the feeling (based on timing results in my logs) that 
processing IronRuby scripts is faster when they run through the ir.exe 
interpreter, than when they are executed in an engine from within a c# 
app.
Could that be because certain optimizations are enabled in ir.exe, or 
something similair?


Thanks for your time!

_______________________________________________ Ironruby-core mailing 
list Ironruby-core@rubyforge.org<mailto:Ironruby-core@rubyforge.org> 
http://rubyforge.org/mailman/listinfo/ironruby-core

_______________________________________________ Ironruby-core mailing 
list Ironruby-core@rubyforge.org<mailto:Ironruby-core@rubyforge.org> 
http://rubyforge.org/mailman/listinfo/ironruby-core
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.