Github user yaooqinn commented on the pull request:
https://github.com/apache/spark/pull/9661#issuecomment-156327126
## test cases
sparse case: 4085 empty --- *S*
```scala
sc.makeRDD(1 to 40950, 4095).groupBy(x=>x).top(5)
```
dense case: 95 empty ---- *D*
```scala
sc.makeRDD(1 to 16380000, 4095).groupBy(x=>x).top(5)
```
## test result
#### 1 without ```runOptimize``` or ``` trim```
case |Class Name | Objects | Shallow Heap | Retained Heap
-------|---------|------------|-------------------|---------------------
*S* |HighlyCompressedMapStatus| 4,095 | 131,040 | >= 34,135,920
*D* |HighlyCompressedMapStatus| 4,095 | 131,040 | >= 1,441,440
#### 2 with ```runOptimze``` and ```trim```
case |Class Name | Objects | Shallow Heap | Retained Heap
-------|---------|------------|-------------------|---------------------
*S* |HighlyCompressedMapStatus| 4,095 | 131,040 | >= 687,960
*D* | HighlyCompressedMapStatus| 4,095 | 131,040 | >= 687,960
#### 3 with ```runOptinize``` and ```trim```, also ```isSparse```
case|Class Name | Objects | Shallow Heap | Retained Heap
-------|---------|------------|-------------------|---------------------
*S* |HighlyCompressedMapStatus| 4,095 | 131,040 | >= 687,960
*D* | HighlyCompressedMapStatus| 4,095 | 131,040 | >= 687,960
## conclusion
1. with ```runOptimize```, roaing saves a lot, especially in *S*
2. after ```runOptimize```, separate sparse case is not necessary
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]