Skip to content

Conversation

Copy link

Copilot AI commented May 19, 2025

This PR converts internal Array usage to Vector for improved performance while maintaining backward compatibility.

Changes

  1. Changed internal storage from Array to Vector:

    • Vector.<Class> for _valueClasses in MonoSignal and OnceSignal
    • Vector.<Object> for _params in Slot
    • Updated NativeMappedSignal to properly handle Vectors
  2. Maintained backward compatibility:

    • All public methods still accept and return Arrays
    • Added conversion functions between Arrays and Vectors
    • Added null checks for Vectors to ensure stability
    • No changes to public interfaces (ISignal, IOnceSignal)

Benefits

  • Better performance: Vectors are more efficient than Arrays for typed collections
  • Type safety: Vector.<Class> provides compile-time type checking
  • Identical API: All existing code using the library will continue to work

This addresses the request to use the more efficient Vector.<> type internally instead of Arrays, while keeping backward compatibility with existing code.

Fixes #66.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • archive.apache.org
    • Triggering command: wget -q REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Vector.<ISignal> over Array? Convert internal Arrays to Vectors for better performance May 19, 2025
Copilot AI requested a review from robertpenner May 19, 2025 18:07
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.

Vector.<ISignal> over Array?

2 participants