Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading BLOB SUB_TYPE TEXT is very very slow [DNET286] #296

Closed
firebird-automations opened this issue Nov 22, 2009 · 8 comments
Closed

Reading BLOB SUB_TYPE TEXT is very very slow [DNET286] #296

firebird-automations opened this issue Nov 22, 2009 · 8 comments

Comments

@firebird-automations
Copy link

Submitted by: Tao Lin (tao)

Attachments:
img.png

Votes: 10

I have a blob text file like define like this:

HtmlChuck BLOB SUB_TYPE TEXT SEGMENT SIZE 80 NOT NULL,

My connection string define like this:

string connectionString = "Data Source={0};Database={1};User=SYSDBA;password=masterkey;Dialect=1;Role=;Connection lifetime=15;Pooling=true;Packet Size=4096;";

I use the 'HtmlChunk' to store html page so that I can display it in runtime. The HtmlChuck value usually 8,000-10,000 bytes long. When I am using the latest http://Firebird.net provider to load the table by DataReader, it took 30 seconds to load 126 records. But if I change not connection to ODBC connection like this:

string connectionString = "DRIVER=Firebird/InterBase(r) driver; UID=SYSDBA; PWD=masterkey; DBNAME={0}:{1};

It took less than 1 second to load the same 126 records.

I think this is http://Firebird.net provider performance issue.

@firebird-automations
Copy link
Author

Commented by: Tao Lin (tao)

After I changed my connectionString's packet size to 8192, it speed up a lot! Now it took about 7 seconds to load 1066 records from database. But compare with my Delphi test project, it's still quite slow. My Delphi test application only take 2 seconds to load 1066 records.

@firebird-automations
Copy link
Author

Commented by: Nicolas (nycolas)

These days at work, we're choosing our database for our future project (in C#⁠} : Firebird or PostgreSQL.

My preference goes to Firebird but... the performance is dramatic with blobs and with the .NET Provider. With PostGreSQL and NPGSQL driver for .Net, it takes only 4-5 seconds to read 140 000 records with 5 fields and one blob per record. With Firebird and http://ADO.Net DataProvider 2.5.2, it takes about 80 seconds to do the same job...

First, I was thinking it was Firebird fault... but I tried the same query in IBExpert, and it takes only a few seconds to read 140 000 records... so I think it's a http://Firebird.net provider performance issue...

@firebird-automations
Copy link
Author

Commented by: Peter Motycak (motycak)

Hi, I'm sending a simulation process

Here is the database and an example project:
(ReadingSlowBlobs.zip): https://groups.google.com/d/msg/firebird_cz/YOjNCQaw_J4/7_9dXdruAgAJ

1. Copy the database (from the Database folder) to the server that is located in LAN network.
2. Open the project, in file named "program.cs" and then set the correct constants (path to server, port ...)
3. Run the program.
4. Loading 3000 entries through LAN takes about 27 seconds.
    Loading 3000 records locally takes about 2 seconds.
5. It should be faster.

Thank you very much for your help.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Fix Version: 6.4.0.0 [ 10884 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Attachment: img.png [ 13299 ]

@firebird-automations
Copy link
Author

Commented by: @cincuranet

@peter Motycak: The loopback is surely faster, because the packet never hits the real network and it's just handled in the OS.

But I also compared pure `isql` with the application. I'm using `set blob all` to fetch the blob content and not only the blob id (which is what IBExpert probably did for you @nicolas, depending on settings). And both applications perform same way. The .NET did it in 14,75s and `isql` in 14,87s, which is virtually the same. See the attached image (http://tracker.firebirdsql.org/secure/attachment/13299/img.png).

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: In Progress [ 3 ] => Closed [ 6 ]

resolution: Cannot Reproduce [ 5 ]

Fix Version: 6.4.0.0 [ 10884 ] =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants