Skip to content

Conversation

vthemelis
Copy link
Contributor

The change should be a no-op in terms of what the function that I changed returns. The obj argument of this recursive function is not actually used anywhere --it only appears in the recursive call and not at the base cases.

str(obj) is a very expensive operation that we end up needlessly going through for O(rows) operations while initialising a DataGrid.

This change significantly improves performance for me: Initialising a DataGrid for a DataFrame of 30k rows goes from 2.4s to 0.4s.

Signed-off-by: Vasilis Themelis [email protected]

The change should be a no-op in terms of what the function that I
changed returns. The obj argument of this recursive function is not
actually used anywhere --it only appears in the recursive call and not
at the base cases.

`str(obj)` is a very expensive operation that we end up
needlessly going through for O(rows) operations while initialising a
DataGrid.

This change significantly improves performance for me: Initialising a
DataGrid for a DataFrame of 30k rows goes from 2.4s to 0.4s.

Signed-off-by: Vasilis Themelis <[email protected]>
@vthemelis vthemelis force-pushed the performance-regression branch from 9d1c3dd to 939dd6b Compare February 7, 2023 09:52
Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This str(obj) was introduced by #298 which was a bug fix for early versions of jupyter_client 7. This was later fixed in a patch version of jupyter_client so I'm fine with removing it now 👍🏽

The test that was introduced in the same PR seems to be passing.

Thanks for your PR!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants