forked from NVIDIA/spark-rapids
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We previously used to cache the `Column.memory_usage` output in `Column._cached_sizeof` but it probably was missed to be included in the recent refactors. This PR re-enables caching of `memory_usage`. `Column.memory_usage` should be a no-op on consecutive calls and **60% faster**: ```python In [1]: import cudf In [2]: s = cudf.Series(["abc ", " d e", None, "10 11 234355"] * 10000000) In [3]: s Out[3]: 0 abc 1 d e 2 <NA> 3 10 11 234355 4 abc ... 39999995 10 11 234355 39999996 abc 39999997 d e 39999998 <NA> 39999999 10 11 234355 Length: 40000000, dtype: object # branch-22.04 In [3]: %timeit s.memory_usage() 2.86 µs ± 53.4 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each) # THIS PR In [3]: %timeit s.memory_usage() 1.77 µs ± 10.8 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) ``` Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) URL: rapidsai/cudf#10345
- Loading branch information
1 parent
c163886
commit 0ae9dc6
Showing
8 changed files
with
20 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters