Repository navigation
Conversation
|
Merged build triggered. |
|
Merged build started. |
|
Test build #32963 has started for PR 6227 at commit |
|
For https://gist.github.com/680ee530655941defcb2, this patch gives a roughly 3x speedup. |
|
Test build #32963 has finished for PR 6227 at commit
|
|
Merged build finished. Test PASSed. |
|
Test PASSed. |
|
Leaving the [WIP] tag on for now while we discuss a few different design decisions. |
|
@rxin @zsxwing In the long term, I think that we should consider a more complete design for buffer pooling in our allocator, including thinking through how / whether we want to support pooling for off-heap modes, how we want to match up allocation requests with things in the pages, whether we want to have more manual control over purging pages from the pool, etc. For the immediate 1.4 term, though, I think a super-simple approach like the one in this patch offers a nice improvement. Because the number of different allocation sizes is relatively small (one or two sizes, tops), I think the simple approach is fine for starters. |
There was a problem hiding this comment.
Just a minor question: I think you want to use LinkedList as Stack since you use pop. Right? If so, here you should use push. push calls addFirst, pop calls removeFirst, while add calls addLast.
There was a problem hiding this comment.
Java's linked list is doubly-linked, so I don't think that this makes a perf. difference or anything, which is why I was a little sloppy here.
There was a problem hiding this comment.
I thought there was a special reason to use pop :)
|
On closer inspection, I'm thinking that we should probably prefer WeakReferences to SoftReferences, since it's probably better to allow this memory to be released sooner in response to memory demand rather than having the heap grow in order to try to keep empty pages in the pool. |
|
@JoshRosen why not round up |
|
+1. WeakReferences is better for cache usage. |
|
@zsxwing I think that all of our internal requests are already power-of-2 sized, so I don't think that's a concern yet. Right now, I think we'll only end up allocating pages whose sizes are drawn from a very small set (maybe 4 or fewer standard page sizes, tops). We might consider adding the rounding later, though. |
|
I see. LGTM except the |
|
Just pushed a commit to fix the WeakReference thing :) |
|
Merged build triggered. |
|
Merged build started. |
|
Test build #33114 has started for PR 6227 at commit |
|
LGTM |
|
Test build #33114 has finished for PR 6227 at commit
|
|
Merged build finished. Test PASSed. |
|
Test PASSed. |
|
LGTM |
|
Thanks for the review. I'm going to merge this into master and branch-1.4 (1.4.0). |
…using heap allocation When on-heap memory allocation is used, ExecutorMemoryManager should maintain a cache / pool of buffers for re-use by tasks. This will significantly improve the performance of the new Tungsten's sort-shuffle for jobs with many short-lived tasks by eliminating a major source of GC. This pull request is a minimum-viable-implementation of this idea. In its current form, this patch significantly improves performance on a stress test which launches huge numbers of short-lived shuffle map tasks back-to-back in the same JVM. Author: Josh Rosen <joshrosen@databricks.com> Closes #6227 from JoshRosen/SPARK-7698 and squashes the following commits: fd6cb55 [Josh Rosen] SoftReference -> WeakReference b154e86 [Josh Rosen] WIP sketch of pooling in ExecutorMemoryManager (cherry picked from commit 7956dd7) Signed-off-by: Josh Rosen <joshrosen@databricks.com>
…using heap allocation When on-heap memory allocation is used, ExecutorMemoryManager should maintain a cache / pool of buffers for re-use by tasks. This will significantly improve the performance of the new Tungsten's sort-shuffle for jobs with many short-lived tasks by eliminating a major source of GC. This pull request is a minimum-viable-implementation of this idea. In its current form, this patch significantly improves performance on a stress test which launches huge numbers of short-lived shuffle map tasks back-to-back in the same JVM. Author: Josh Rosen <joshrosen@databricks.com> Closes apache#6227 from JoshRosen/SPARK-7698 and squashes the following commits: fd6cb55 [Josh Rosen] SoftReference -> WeakReference b154e86 [Josh Rosen] WIP sketch of pooling in ExecutorMemoryManager
…using heap allocation When on-heap memory allocation is used, ExecutorMemoryManager should maintain a cache / pool of buffers for re-use by tasks. This will significantly improve the performance of the new Tungsten's sort-shuffle for jobs with many short-lived tasks by eliminating a major source of GC. This pull request is a minimum-viable-implementation of this idea. In its current form, this patch significantly improves performance on a stress test which launches huge numbers of short-lived shuffle map tasks back-to-back in the same JVM. Author: Josh Rosen <joshrosen@databricks.com> Closes apache#6227 from JoshRosen/SPARK-7698 and squashes the following commits: fd6cb55 [Josh Rosen] SoftReference -> WeakReference b154e86 [Josh Rosen] WIP sketch of pooling in ExecutorMemoryManager
…using heap allocation When on-heap memory allocation is used, ExecutorMemoryManager should maintain a cache / pool of buffers for re-use by tasks. This will significantly improve the performance of the new Tungsten's sort-shuffle for jobs with many short-lived tasks by eliminating a major source of GC. This pull request is a minimum-viable-implementation of this idea. In its current form, this patch significantly improves performance on a stress test which launches huge numbers of short-lived shuffle map tasks back-to-back in the same JVM. Author: Josh Rosen <joshrosen@databricks.com> Closes apache#6227 from JoshRosen/SPARK-7698 and squashes the following commits: fd6cb55 [Josh Rosen] SoftReference -> WeakReference b154e86 [Josh Rosen] WIP sketch of pooling in ExecutorMemoryManager
### What changes were proposed in this pull request? This PR aims to upgrade FasterXML Jackson to 2.22.4. ### Why are the changes needed? Jackson 2.22.4 is the latest patch release on the 2.22 line. - https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.22.4 (2026-10-17) - Streaming - [#1683](FasterXML/jackson-core#1683) `ReaderBasedJsonParser` accepts lone surrogates in `\uXXXX` escapes in field names - [#1744](FasterXML/jackson-core#1744) `UTF8DataInputJsonParser` fails on JSON-escaped surrogate pairs in property names - [#1750](FasterXML/jackson-core#1750) `ALLOW_UNESCAPED_CONTROL_CHARS` is ignored for single-quoted string values in UTF-8 byte parsers - [#1742](FasterXML/jackson-core#1742), [#1746](FasterXML/jackson-core#1746), [#1756](FasterXML/jackson-core#1756) Non-blocking parser fixes for escaped surrogate pairs, leading decimal point numbers, and multi-byte UTF-8 characters after a backslash escape - [#1730](FasterXML/jackson-core#1730) `FilteringGeneratorDelegate` handles embedded objects, typed arrays, and raw/binary values consistently - Databind - CVE-2026-110879 [#6287](FasterXML/jackson-databind#6287) Validate type parameters and array element types of type ids - [#6206](FasterXML/jackson-databind#6206) Report a cycle through a `JsonValue` accessor as a `DatabindException` - [#6227](FasterXML/jackson-databind#6227) `BeanDescription.findProperties()` is not thread-safe on a shared, cached instance - [#6249](FasterXML/jackson-databind#6249) Avoid an NPE when the parser reports `VALUE_STRING` with null text - CBOR - CVE-2026-106554 [#821](FasterXML/jackson-dataformats-binary#821) Grow the `CBORParser.TagList` backing array geometrically `jackson-annotations` stays at 2.22 as referenced by `jackson-bom` 2.22.4. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Sonnet 5.5 Closes #60004 from dongjoon-hyun/SPARK-60799. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
When on-heap memory allocation is used, ExecutorMemoryManager should maintain a cache / pool of buffers for re-use by tasks. This will significantly improve the performance of the new Tungsten's sort-shuffle for jobs with many short-lived tasks by eliminating a major source of GC.
This pull request is a minimum-viable-implementation of this idea. In its current form, this patch significantly improves performance on a stress test which launches huge numbers of short-lived shuffle map tasks back-to-back in the same JVM.