Construct ClosureVariableAccess

Performance Diagrams

Construct ClosureVariableAccess 00200000200000400000400000600000600000800000800000100000010000001200000120000014000001400000160000016000001800000180000020000002000000CPython 3.12Nuitka (main)Nuitka (develop)Nuitka (factory)219896889.78846153846155257.0CPython 3.12350000244.59615384615387464.78312302022516Nuitka (main)350000399.4038461538462464.78312302022516Nuitka (develop)350000554.2115384615385464.78312302022516Nuitka (factory)Construct ClosureVariableAccessTicks Construct ClosureVariableAccess 002000002000004000004000006000006000008000008000001000000100000012000001200000140000014000001600000160000018000001800000CPython 3.11Nuitka (main)Nuitka (develop)Nuitka (factory)184863389.78846153846155257.0CPython 3.11250000244.59615384615387470.6967200379124Nuitka (main)250000399.4038461538462470.6967200379124Nuitka (develop)250000554.2115384615385470.6967200379124Nuitka (factory)Construct ClosureVariableAccessTicks Construct ClosureVariableAccess 0020000020000040000040000060000060000080000080000010000001000000120000012000001400000140000016000001600000180000018000002000000200000022000002200000240000024000002600000260000028000002800000CPython 3.10Nuitka (main)Nuitka (develop)Nuitka (factory)284852989.78846153846155257.0CPython 3.10250000244.59615384615387482.4274024485027Nuitka (main)250000399.4038461538462482.4274024485027Nuitka (develop)250000554.2115384615385482.4274024485027Nuitka (factory)Construct ClosureVariableAccessTicks Construct ClosureVariableAccess 0010000001000000200000020000003000000300000040000004000000CPython 2.7Nuitka (main)Nuitka (develop)Nuitka (factory)456327589.78846153846155257.0CPython 2.7200000244.59615384615387493.284769120356Nuitka (main)200000399.4038461538462493.284769120356Nuitka (develop)200000554.2115384615385493.284769120356Nuitka (factory)Construct ClosureVariableAccessTicks

Source Code with Construct

        if cond:
            local_value1 = closure_value

        return local_value1 + local_value2

    # Make it clear that the closure cannot be trusted and there
    # is no inlining possible.
    return f, f()


for x in itertools.repeat(None, 50000):
    # construct_begin
    calledRepeatedly(True)
    # construct_alternative



print("OK.")

#     Python test originally created or extracted from other peoples work. The
#     parts from me are licensed as below. It is at least Free Software where
#     it's copied from other people. In these cases, that will normally be
#     indicated.
#
#     Licensed under the Apache License, Version 2.0 (the "License");
#     you may not use this file except in compliance with the License.
#     You may obtain a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#     Unless required by applicable law or agreed to in writing, software
#     distributed under the License is distributed on an "AS IS" BASIS,
#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#     See the License for the specific language governing permissions and
#     limitations under the License.

Source Code without Construct

        if cond:
            local_value1 = closure_value

        return local_value1 + local_value2

    # Make it clear that the closure cannot be trusted and there
    # is no inlining possible.
    return f, f()


for x in itertools.repeat(None, 50000):
    # construct_begin

    # construct_alternative
    calledRepeatedly(False)
    # construct_end

print("OK.")

#     Python test originally created or extracted from other peoples work. The
#     parts from me are licensed as below. It is at least Free Software where
#     it's copied from other people. In these cases, that will normally be
#     indicated.
#
#     Licensed under the Apache License, Version 2.0 (the "License");
#     you may not use this file except in compliance with the License.
#     You may obtain a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#     Unless required by applicable law or agreed to in writing, software
#     distributed under the License is distributed on an "AS IS" BASIS,
#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#     See the License for the specific language governing permissions and
#     limitations under the License.