as3-signals icon indicating copy to clipboard operation
as3-signals copied to clipboard

Convert internal Arrays to Vectors for better performance

Open Copilot opened this issue 9 months ago • 0 comments

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 avatar May 19 '25 17:05 Copilot