toshok / toshok/echojs

Sparse Array objects impl

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
431
Forks
20
PR merge metrics
No merged PRs in 30d

Description

It looks like SpiderMonkey, in the case of sparse arrays, fallbacks to simple property access* (i.e. arr[450] gets the '450' property, if any).

Wouldn't that work here for now, instead of creating a huge array? (for arrays > SOME_HUGE_VALUE, that is).

  • It looks like SP uses some checks here and there to detect this case, based on the use-case.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the runtime code that creates and accesses array objects, then trace how sparse arrays and very large indices are handled. Compare that path with the issue's SpiderMonkey reference and determine how property access should behave above SOME_HUGE_VALUE. Done means sparse arrays no longer require allocating a huge backing array while indexed properties still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.