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

Scrolling attribute table of a layer added with the "delimted text provider" is almost impossible #38068

Closed
gioman opened this issue Jul 31, 2020 · 10 comments · Fixed by #38735
Closed
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers Regression Something which used to work, but doesn't anymore

Comments

@gioman
Copy link
Contributor

gioman commented Jul 31, 2020

QGIS 3.14/master, Linux and Windows.

I added a delimited text layer from a 18k rows CSV (so not exactly a big dataset) and scrolling the table of attributes is basically impossible (way too slow, almost now moving, also causing freezes).

I tested the same CSV on 2.18 and it was almost fine (it works except for some hiccup).

@gioman gioman added Data Provider Related to specific vector, raster or mesh data providers Regression Something which used to work, but doesn't anymore Bug Either a bug report, or a bug fix. Let's hope for the latter! labels Jul 31, 2020
@nyalldawson
Copy link
Collaborator

I suspect it's related to the recent View Selection performance issue too

@gioman
Copy link
Contributor Author

gioman commented Aug 3, 2020

@signedav ping just to let you know that this is maybe related to #38018

@signedav
Copy link
Contributor

signedav commented Aug 6, 2020

Hi @gioman I cannot reproduce the issue. Can you provide me the CSV file?

Edit: I tested with a 50k rows on 100 columns but a dummy file with just strings and ints. So maybe it's not representative.

@gioman
Copy link
Contributor Author

gioman commented Aug 6, 2020

I cannot reproduce the issue.

with or without the latest patch (the revert of the previous patch)?

Can you provide me the CSV file?

sure:

sample_csv.zip

CRS of data is EPSG 32629. For some reason I just noticed that if the table is docked then it is usable (barely considered that it is really a small dataset), while not docked full screen is really unsable. I'm on master on Ubuntu 18.04.

@signedav
Copy link
Contributor

signedav commented Aug 6, 2020

Right now I have the master on that state of last week 4f34b8a with Ubuntu 20.04.
Open the attribute table takes some seconds. Changing the filter leads to the other issue here #38018
But scrolling works fine. Are there other leads? Or can you do a test when you can compile again?

@gioman
Copy link
Contributor Author

gioman commented Aug 6, 2020

But scrolling works fine.

definitely not working fine here... let me test on other systems.

@gioman
Copy link
Contributor Author

gioman commented Aug 6, 2020

@signedav adding that CSV as geometryless table (i.e. by d&d the csv on the canvas) results is a quick table, you must add it as delimited text (spatial) table to see the slow down.

@signedav
Copy link
Contributor

signedav commented Aug 7, 2020

Thanks. I can reproduce on master. Haven't found the reason yet.

@signedav
Copy link
Contributor

signedav commented Aug 7, 2020

I checked out the commit c6823d8 what is the last commit of the implementation that contained the reason for #38018 but the scrolling was fine (maybe sometimes minimal hickups - but master lags clearly)
This leads me to the conclusion that these issues are not directly related.

On master I imported the data to a geopackage - means I opened the delimited layer and dragged it into an existing geopackage: The scrolling was fine on this layer. Maybe that's a lead. But I don't know.

@rouault
Copy link
Contributor

rouault commented Sep 1, 2020

Thanks to @nyalldawson live debugging section, it was found this is caused by 644a564 . 99% time is spent in QString::indexOf()

@rouault rouault self-assigned this Sep 14, 2020
rouault added a commit to rouault/QGIS that referenced this issue Sep 14, 2020
…nd-of-line characters

Fixes qgis#38068

The performance regression was introduced per commit 644a564
It resulted in quadratic performance in the size of the buffer for CSV files
with Unix '\n' end of line character, due to scanning repeatedly for `\r`
nyalldawson pushed a commit that referenced this issue Sep 14, 2020
…nd-of-line characters

Fixes #38068

The performance regression was introduced per commit 644a564
It resulted in quadratic performance in the size of the buffer for CSV files
with Unix '\n' end of line character, due to scanning repeatedly for `\r`
nyalldawson pushed a commit to nyalldawson/QGIS that referenced this issue Oct 5, 2020
…nd-of-line characters

Fixes qgis#38068

The performance regression was introduced per commit 644a564
It resulted in quadratic performance in the size of the buffer for CSV files
with Unix '\n' end of line character, due to scanning repeatedly for `\r`

(cherry picked from commit a667844)
nyalldawson pushed a commit that referenced this issue Oct 23, 2020
…nd-of-line characters

Fixes #38068

The performance regression was introduced per commit 644a564
It resulted in quadratic performance in the size of the buffer for CSV files
with Unix '\n' end of line character, due to scanning repeatedly for `\r`

(cherry picked from commit a667844)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers Regression Something which used to work, but doesn't anymore
Projects
None yet
4 participants