Commit 7df6008
committed
Optimizations related to zeroing out memory:
- Do not zero out all allocated memory; the zeroing isn't free and in many
cases it isn't necessary.
- There are some cases where we do want to clear the memory, such as in BitSet.
It shouldn't be the BitSet object's responsibility to zero out the memory
block passed to it (since maybe we're passing some memory created by someone
else and want to interpret it as a bitset). To make the caller's life easier,
though, I added a MemoryBlock.zero() method for clearing the block.
- In UnsafeGeneratedAggregate, use Arrays.fill to clear the re-used temporary
row buffer, since this is likely to be much faster than Unsafe.setMemory;
see http://psy-lob-saw.blogspot.com/2015/04/on-arraysfill-intrinsics-superword-and.html
for more details.1 parent c1b3813 commit 7df6008
File tree
7 files changed
+21
-19
lines changed- sql/core/src/main/scala/org/apache/spark/sql/execution
- unsafe/src
- main/java/org/apache/spark/unsafe
- array
- map
- memory
- test/java/org/apache/spark/unsafe/bitset
7 files changed
+21
-19
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | | - | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
295 | 296 | | |
296 | 297 | | |
297 | 298 | | |
298 | | - | |
299 | | - | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| |||
Lines changed: 0 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 43 | | |
53 | 44 | | |
54 | 45 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 25 | + | |
29 | 26 | | |
30 | 27 | | |
31 | 28 | | |
| |||
452 | 449 | | |
453 | 450 | | |
454 | 451 | | |
455 | | - | |
| 452 | + | |
456 | 453 | | |
457 | 454 | | |
458 | 455 | | |
| |||
525 | 522 | | |
526 | 523 | | |
527 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments