Skip to content

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

@GoogleCodeExporter

Description

@GoogleCodeExporter
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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions