Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate Bytes::blit #1572

Merged
merged 2 commits into from
Jan 24, 2025
Merged

deprecate Bytes::blit #1572

merged 2 commits into from
Jan 24, 2025

Conversation

Yu-zh
Copy link
Collaborator

@Yu-zh Yu-zh commented Jan 24, 2025

No description provided.

Copy link

peter-jerry-ye-code-review bot commented Jan 24, 2025

‼️ This code review is generated by a bot. Please verify the content before trusting it.

⚠️ [Deprecated method marked but not removed, potential dead code]
  • Category: Maintainability
  • Code Snippet: builtin.mbti line 721: blit(Bytes, Int, Bytes, Int, Int) -> Unit //deprecated
  • Recommendation: Remove the method declaration entirely or use proper deprecation syntax if supported
  • Reasoning: The method is marked as deprecated in comment but remains in the interface. This creates ambiguity and technical debt. The bytes_block.mbt file already contains a proper @alert deprecated marker, making this redundant.
⚠️ [Critical error handling tests removed for deprecated function]
  • Category: Correctness
  • Code Snippet: panic_test.mbt lines 197-215 removed blit error tests
  • Recommendation: Keep error tests until the method is fully removed
  • Reasoning: Even deprecated methods should maintain their specified error behavior until removal. Removing tests prematurely could allow regressions in dependent code during migration period.
💡 [Potential performance regression in Bytes::copy]
  • Category: Performance
  • Code Snippet: bytes.mbt line 240: Bytes::makei(self.length(), fn(i) { self[i] })
  • Recommendation: If performance is critical, implement a bulk copy mechanism for the new immutable Bytes type
  • Reasoning: The new implementation does O(n) element-wise copying compared to potential O(1) memory copy in original blit approach. For large byte sequences, this could be significantly slower. Consider adding a optimized path in the runtime for immutable byte array duplication.

@coveralls
Copy link
Collaborator

coveralls commented Jan 24, 2025

Pull Request Test Coverage Report for Build 5096

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.005%) to 85.905%

Totals Coverage Status
Change from base Build 5093: -0.005%
Covered Lines: 5278
Relevant Lines: 6144

💛 - Coveralls

@Yu-zh Yu-zh force-pushed the deprecate-bytes-blit branch from 3cda8c0 to 24722db Compare January 24, 2025 07:54
@bobzhang bobzhang added this pull request to the merge queue Jan 24, 2025
Merged via the queue into moonbitlang:main with commit dca313d Jan 24, 2025
14 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.

3 participants