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

Table performance issue with massive data #390

Closed
ripitrust opened this issue Dec 27, 2016 · 20 comments
Closed

Table performance issue with massive data #390

ripitrust opened this issue Dec 27, 2016 · 20 comments

Comments

@ripitrust
Copy link

  • Package version(s): 1.2.0
  • Browser and OS versions: <macOS 10.12.2 Chrome 55.0.2883.95 >

Issues

  1. when rendering a huge amount of data ( 50+ rows with 44 columns ), the performance of scrolling (both horizontal and vertical ) is significantly slow

  2. I notice that if the height of the table is small ( as shown in the documentation example), this issue is gone. However if my table height is as high as the browser window, this will happen.

Just want to know if there is any optimization tips on the table?

@avin
Copy link

avin commented Jan 2, 2017

Performance is much-much better when you build app in production mode
http://dev.topheman.com/make-your-react-production-minified-version-with-webpack/

@giladgray
Copy link
Contributor

giladgray commented Jan 2, 2017

oh yes what @avin said is the greatest React optimization tip of all time. React dev mode is noticeably slower than production mode because it does lots of extra runtime validation that is useful for development but shouldn't be needed on your prod site.

@ripitrust
Copy link
Author

@avin @giladgray Yes I noticed that, changing to production model makes it significantly faster

But when rendering a large viewpoint, the speed is still noticeably lagging

@giladgray
Copy link
Contributor

There are two things at play here: how the table renders itself (which is very complex to begin with), and how you store your data. Trying to determine where the slowness is... I'm curious how you're using the table. @ripitrust would you be able to share your setup code?

@ripitrust
Copy link
Author

ripitrust commented Jan 4, 2017

@giladgray Thanks for the reply

currently I am passing datas into a wrapper component :

<Table data={servers} />

in this wrapper component I render the actual blueprint table:

render(){
        const { _renderCell } = this;
        const { data, tableHeight } = this.props;
        const numOfServers = data.length;

        const keys = this._getKeyArray(data);

        return (

            <div style={{height:tableHeight}}>

                <Table numRows={numOfServers}
                       style={{height:tableHeight}}
                        defaultColumnWidth={100}>

                    { keys.map( function(key, index) {

                        return <Column name={key} key={index} renderCell={_renderCell(keys)}/>

                    })}

                </Table>
            </div>
        )

 }

@adidahiya
Copy link
Contributor

@ripitrust what does renderCell look like? Might be easier if you posted a gist on gist.github.com

@ripitrust
Copy link
Author

@kraf
Copy link

kraf commented Jan 12, 2017

I also have performance issues with my table. Don't get me wrong, your virtualizing works really well, so it's not that noticeable but the CPU load gets pretty high.
It seems that renderCell is getting called a lot when scrolling and I was wondering if there's a way to hint the table component, that my data hasn't changed. I used data versions passed as a prop (incrementing number, timestamp, hash, ...) in a similar case before. The table would then only call renderCell if the cell gets close to the viewport.

@adidahiya
Copy link
Contributor

We're going to start investing in table rendering performance in the next few weeks; I think @gscshoyru will have some bandwidth to investigate.

@dubcanada
Copy link

I think something simple like how https://facebook.github.io/fixed-data-table/ and other data tables work where you limit the amount of currently rendered rows too a specific size (say 15 rows or what not) and then render just 15 rows, and as you scroll remove out of view rows and show newly in view rows.

@llorca
Copy link
Contributor

llorca commented Jan 26, 2017

We already do that. It's called virtual rendering, it's not that trivial. We still have many improvements to do around performance, so look out for updates soon

@llorca llorca modified the milestones: 1.9.0, 1.10.0 Feb 3, 2017
@llorca llorca removed this from the 1.10.0 milestone Feb 21, 2017
@adidahiya adidahiya added the P1 label Feb 26, 2017
@michael-yx-wu
Copy link
Contributor

@ripitrust I'm chiming in a bit late but I've noticed that rendering performance for a large table is rather degraded on Chrome, but not on Safari or Firefox. Can you confirm?

@ripitrust
Copy link
Author

@michael-yx-wu I would say it is slightly slower in Chrome (macOS) than in safari, just barely noticeable

@llorca
Copy link
Contributor

llorca commented Mar 10, 2017

Stumbled upon this excellent React talk about virtualization and windowing in general: https://bvaughn.github.io/forward-js-2017/

@tgreenwatts
Copy link
Contributor

I think we can close this and reference it in future more targeted perf discussions

@adidahiya
Copy link
Contributor

ehh I think the discussion thread is valuable & good for searchability. I'd like to keep it open

@adidahiya adidahiya reopened this Apr 6, 2017
@tgreenwatts
Copy link
Contributor

We've done a lot of work in terms of perf here, I'm going to close this, it's still searchable, but we can open a new more targeted ticket for new perf concerns

@marianhlavac
Copy link

marianhlavac commented Feb 11, 2019

@tgreenwatts Issues described here in comments were not resolved. I'm experiencing the same performance issues. Why is this issue closed?

Even with running in production mode, table of size 1400x400px (only 18 rows visible!) containing only 7 columns and only (yes, only, because tables are meant for large data) about 1200 rows, it's unusable, scrolling or selecting is very slow or worse, sometimes when scrolling, some of the cells get rendered, some of them not.

Oh and I didn't mention the CPU load. Horrible. All macbooks spins up immediately like they're trying to fly away.

@archywillhe
Copy link

archywillhe commented Dec 27, 2020

as of 2021 the performance is still pretty bad; wonder if this is really what palantir uses in production or they simply dont display lots of cells at once hmmm e.g. 100,000 cells

@tihuan
Copy link

tihuan commented Oct 13, 2021

Haven't tried this yet, but wonder if it's possible to use react-window and/or react-virtualized with the Table component 🤔

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