HTML Preparation code:
AخA
 
1
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.27.1/ramda.min.js"></script>
Script Preparation code:
 
var blocks = [
    {
        "id": "bv2Q3fR8j",
        "width": 160,
        "height": 160,
        "name": "blank",
        "type": "blank",
        "op": {
            "type": "blank"
        },
        "view": {
            "type": "BlankBlock"
        },
        "handlers": {
            "source": true,
            "target": true
        },
        "x": 0,
        "y": 0,
        "validate": {
            "rule": "equal",
            "value": "input.array.ability"
        }
    },
    {
        "id": "6e5aE55OD",
        "width": 160,
        "height": 160,
        "type": "label",
        "op": {
            "type": "label"
        },
        "view": {
            "type": "LabelBlock"
        },
        "name": "answer",
        "required": true,
        "handlers": {
            "source": true,
            "target": null
        },
        "x": 0,
        "y": 300
    },
    {
        "id": "ULidMw-z2",
        "width": 160,
        "height": 160,
        "name": "onehot",
        "type": "preprocessing.OneHot",
        "op": {
            "type": "preprocessing.OneHot"
        },
        "view": {
            "type": "EmptyBlock"
        },
        "handlers": {
            "source": true,
            "target": true
        },
        "options": {
            "max_len": 24,
            "feature_columns": [
                {
                    "key": "type1",
                    "vocabulary_list": [
                        "normal",
                        "grass",
                        "dragon",
                        "bug",
                        "ice",
                        "water",
                        "fighting",
                        "poison",
                        "ground",
                        "psychic",
                        "rock",
                        "fire",
                        "electric",
                        "ghost",
                        "dark",
                        "steel",
                        "fairy",
                        "flying"
                    ]
                }
            ]
        },
        "hidden": true,
        "required": true
    },
    {
        "id": "kSWU25MDc",
        "width": 160,
        "height": 160,
        "name": "Preprocessing",
        "type": "preprocessing.ConstantScaler",
        "op": {
            "type": "preprocessing.ConstantScaler"
        },
        "view": {
            "type": "EmptyBlock"
        },
        "handlers": {
            "source": true,
            "target": true
        },
        "options": {
            "value": 0.00392156862
        },
        "hidden": true,
        "required": true
    },
    {
        "id": "T2-7CdlVh",
        "width": 160,
        "height": 160,
        "name": "blank",
        "type": "blank",
        "op": {
            "type": "blank"
        },
        "view": {
            "type": "BlankBlock"
        },
        "handlers": {
            "source": true,
            "target": true
        },
        "x": 250,
        "y": 0,
        "validate": {
            "rule": "equal",
            "value": "layer.PokemonTiny"
        }
    },
    {
        "id": "yNHnSTUb6",
        "width": 160,
        "height": 160,
        "name": "prediction",
        "type": "generatedLabels",
        "op": {
            "type": "generatedLabels"
        },
        "view": {
            "type": "GeneratedLabelsBlock"
        },
        "required": true,
        "handlers": {
            "source": null,
            "target": true
        },
        "x": 500,
        "y": 0,
        "options": {
            "labels": [
                "일반",
                "전설"
            ],
            "onlyTop": true
        }
    }
]
Tests:
  • Ramda find with R.pipe

     
    R.find(R.pipe(R.prop('type'), R.includes('Preprocessing')))(blocks)
  • Ramda find

     
    R.find((block) => block.type === "Preprocessing")(blocks)
  • Native find

     
    blocks.find((block) => block.type === "Preprocessing")
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Ramda find with R.pipe
    Ramda find
    Native find

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
Chrome 100 on Windows
View result in a separate tab
Test name Executions per second
Ramda find with R.pipe 194221.1 Ops/sec
Ramda find 1055377.5 Ops/sec
Native find 4756480.0 Ops/sec