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

Support large TypedArrays #44

Open
jmacmahon opened this issue Feb 18, 2024 · 2 comments
Open

Support large TypedArrays #44

jmacmahon opened this issue Feb 18, 2024 · 2 comments
Labels

Comments

@jmacmahon
Copy link

Hi and thanks for the great project,

I'm writing a browser app that uses the Web Audio APIs and my state includes several large (~40MB) Float32Arrays of decoded audio data. Trying to dump the state using objectInspect causes the tab to freeze, presumably because it tries to stringify every value of the array. Would it be possible to output Float32Array [ 42, 42, 42, ... ] for these kinds of values, like the example in the README that includes a ... for deeply nested DOM elements?

@ljharb
Copy link
Member

ljharb commented Feb 18, 2024

We could certainly add an option like util.inspect's maxArrayLength - altho our default would be Infinity, and i'd prefer a better name (it's called "array" but controls all collection types).

@ljharb ljharb added enhancement help wanted Please send a PR! labels Feb 18, 2024
@jmacmahon
Copy link
Author

Oh yes, maxArrayLength seems like a good solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants