What?
You mean it's not reading?
Ok, I'll explain it in a another way:
- uncomment the table.Add code -> it takes 180 s in my case
- replace table (which is a Hashtable) by an ArrayList -> it goes down
to 50 seconds
- remove any "code adding" functionality -> 50 seconds
Is it clearer now?
If
> object val;
>
> while( reader.Read() )
> {
> for( int j = 0; j < reader.FieldCount; ++j )
> val=reader[j];
> // table.Add(count, val);
> ++count;
> }
It might be that when you don't use val, the optimizer is not executing all
of the code, and so
Results are different with Mono on Windows -> it doesn't get affected by
the "hashtable", although in Mono there's a different performance hit ->
if you read fields by field name instead of index your speed is slowed
down to a half
[EMAIL PROTECTED] escribió:
> No, I didn't.
>
> As I told this
No, I didn't.
As I told this is not a *real* production code. What I actually do in
the real code is add one object per record, so my sample was right.
The problem is why adding to a hashtable kills reader performance...
Steve Faleiro escribió:
>>> while( reader.Read() )
>>> {
>>>
>> while( reader.Read() )
>> {
>> for( int j = 0; j < reader.FieldCount; ++j )
>>val=reader[j];
>> // table.Add(count, val);
>> ++count;
>> }
while( reader.Read() )
{
for( int j = 0; j < reader.FieldCount; ++j )
{
Hi there,
Here I'm trying to save some miliseconds with the Firebird provider
(using embedded database!)
Well, I've a weird problem and I'd like you to take a look into it.
Well, I'm using the following code to read data from a Firebird database:
object val;
while( reader.Read() )