# Performance of INHERIT-META

**URL:** <https://revolt.metaeducation.com/forum/t/performance-of-inherit-meta/1619>\
**Category:** Testing\
**Created:** [June 3, 2021, 9:26pm UTC](https://revolt.metaeducation.com/forum/t/performance-of-inherit-meta/1619 "2021-06-03T21:26:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hostilefork](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/hostilefork/32/421_2.png) [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Post date:** [June 3, 2021, 9:26pm UTC](https://revolt.metaeducation.com/forum/t/performance-of-inherit-meta/1619/1 "2021-06-03T21:26:51Z")

</div>

I did a little bit of performance sampling and noticed a fair bit of boot time was spent in a function called INHERIT-META. It's was called often, and it was slow.

Carl & BrianH & co were big fans of taking bottleneck functions and making them natives. I've tried to avoid that for "weird" functions, but I will make an exception here.

I'm keeping a copy of the original code, which isn't even complete...despite being slow. :-/

```
inherit-meta: func* [
    return: "Same as derived (assists in efficient chaining)"
        [action!]
    derived [action!]
    original "Passed as WORD! to use GET to avoid tainting cached label"
        [word!]
    /augment "Additional spec information to scan"
        [block!]
][
    original: get original ; GET so `specialize :foo [...]` keeps label foo

    if let m1: meta-of :original [
        set-meta :derived let m2: copy :m1 ; shallow copy
        if select m1 'parameter-notes [ ; shallow copy, but make frame match
            m2/parameter-notes: make frame! :derived
            for-each [key value] m1/parameter-notes [
                if in m2/parameter-notes key [
                    m2/parameter-notes/(key): get* 'value ; !!! BAD-WORD!s
                ]
            ]
        ]
        if select m1 'parameter-types [ ; shallow copy, but make frame match
            m2/parameter-types: make frame! :derived
            for-each [key value] m1/parameter-types [
                if in m2/parameter-types key [
                    m2/parameter-types/(key): get* 'value ; !!! BAD-WORD!s
                ]
            ]
        ]
    ]
    return get 'derived ; no :derived name cache
]

```

---

<div class="post-metadata">

**Author:** ![iArnold](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/iarnold/32/226_2.png) [@iArnold](https://revolt.metaeducation.com/forum/u/iArnold)\
**Post date:** [June 4, 2021, 8:09pm UTC](https://revolt.metaeducation.com/forum/t/performance-of-inherit-meta/1619/2 "2021-06-04T20:09:28Z")

</div>

Main point is, what is it supposed to do?
