Skip to content

Conversation

@SyMind
Copy link
Collaborator

@SyMind SyMind commented Sep 24, 2025

This PR implements flattening for nested ConcatSource instances to improve performance by avoiding deeply nested source structures. The optimization flattens ConcatSource children during construction and addition operations.

Copilot AI review requested due to automatic review settings September 24, 2025 09:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements flattening for nested ConcatSource instances to improve performance by avoiding deeply nested source structures. The optimization flattens ConcatSource children during construction and addition operations.

  • Refactored ConcatSource::new() to use iterative add() method instead of flat_map
  • Enhanced add() method to flatten both direct ConcatSource instances and BoxSource-wrapped ConcatSource instances
  • Updated buffer() implementation to use to_writer() for consistency

Reviewed Changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

File Description
src/concat_source.rs Main implementation of nested ConcatSource flattening with updated constructor, add method, and buffer implementation
src/cached_source.rs Updated buffer method to use to_writer for consistency with ConcatSource changes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 24, 2025

CodSpeed Performance Report

Merging #166 will not alter performance

Comparing SyMind:refactor-buffer (1a2fc63) with main (0ac0616)

Summary

✅ 7 untouched

@SyMind SyMind merged commit 79e2dfc into rstackjs:main Sep 24, 2025
7 checks passed
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.

1 participant