Skip to content

performance of Uint8Array.prototype.setFrom{Base64,Hex} #57

@phoddie

Description

@phoddie

The excellent notes from @anba on additional tests made me realize that XS does not implement these methods as expected by the spec text.

Uint8Array.prototype.setFrom{Base64,Hex} doesn't modify the typed array when the input string is invalid.

My recollection is that BYOB was proposed by @syg as a performance optimization. Requiring full validation of the input before modifying the output reduces the performance gain: either two full passes over the source data are necessary or a temporary buffer is needed to store the decoded data before updating the destination.

If leaving the destination unmodified for invalid input takes priority, that's fine. But, since performance was the motivator, I want to check before making changes. I couldn't find previous discussion about this tradeoff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions