Object iteration

Benchmark created on


Setup

const obj = {
"item:slug:dread-ampoule-lesser": [
        {
            "overrides": [
                "item:group:bomb"
            ],
            "trigger": "attack-roll",
            "contents": [
                {
                    "preset": "ranged",
                    "options": {
                        "waitUntilFinished": -250
                    },
                    "contents": [
                        {
                            "predicate": [
                                "jb2a:patreon"
                            ],
                            "file": "jb2a.throwable.throw.flask.01.purple"
                        },
                        {
                            "predicate": [
                                "jb2a:free"
                            ],
                            "file": "jb2a.throwable.throw.flask.01.orange",
                            "options": {
                                "filter": {
                                    "type": "ColorMatrix",
                                    "options": {
                                        "hue": -80
                                    }
                                }
                            }
                        }
                    ]
                },
                {
                    "preset": "onToken",
                    "file": "jb2a.smoke.puff.ring.01.white.1",
                    "predicate": [
                        {
                            "or": [
                                "check:outcome:success",
                                "check:outcome:failure",
                                "check:outcome:critical-failure"
                            ]
                        }
                    ],
                    "options": {
                        "preset": {
                            "location": "target"
                        },
                        "tint": "#846e9c",
                        "scaleToObject": {
                            "value": 1.5
                        }
                    }
                },
                {
                    "preset": "onToken",
                    "file": "jb2a.smoke.puff.ring.01.white.0",
                    "predicate": [
                        "check:outcome:critical-success"
                    ],
                    "options": {
                        "preset": {
                            "location": "target"
                        },
                        "tint": "#846e9c",
                        "scaleToObject": {
                            "value": 1.5
                        }
                    }
                }
            ]
        }
    ],
}

Test runner

Ready to run.

Testing in
TestOps/sec
stringify + parse
JSON.parse(JSON.stringify(obj))
ready
structuredClone
structuredClone(obj)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.