bbqchickenrobot / csharp-sqlite

Automatically exported from code.google.com/p/csharp-sqlite
Other
0 stars 0 forks source link

String.Substring is very slow and floods garbage collector #183

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Execute some long queries or create table statements while profiling the 
memory and notice that it is extreme bloat
2.
3.

What is the expected output? What do you see instead?
In my examples I am loading a database file that is ~50kb extremely small file. 
Just doing and select * from ... on all the tables i end up using ~5mb of 
memory that is nearly 100 times larger than the actual size of the database.

Sure there is overhead but calling Substring while parsing a long query is 
going to create n-1 new strings. The C code uses simple pointer arithmetic to 
no copy the data so much. Is it possible to use char[] and indexes instead of 
string.substring? 

What version of the product are you using? On what operating system?
3.7

Please provide any additional information below.

I absolutely love the framework but would love for it to be lighter. We are 
using it with Unity and it works great thanks.

Original issue reported on code.google.com by chwiela...@gmail.com on 8 Feb 2014 at 5:13

GoogleCodeExporter commented 9 years ago
I will investigate this, and see what can be done.

Original comment by uygar.raf@gmail.com on 17 Feb 2014 at 3:03

GoogleCodeExporter commented 9 years ago

Original comment by uygar.raf@gmail.com on 24 Oct 2014 at 2:10

GoogleCodeExporter commented 9 years ago

Original comment by uygar.raf@gmail.com on 24 Oct 2014 at 3:53