Construct ClosureVariableAccess

Performance Diagrams

Construct ClosureVariableAccess 00200000200000400000400000600000600000800000800000100000010000001200000120000014000001400000160000016000001800000180000020000002000000CPython 3.12Nuitka (main)Nuitka (develop)Nuitka (factory)219892289.78846153846155257.0CPython 3.12350000244.59615384615387464.78230021521733Nuitka (main)350001399.4038461538462464.7821878349762Nuitka (develop)350001554.2115384615385464.7821878349762Nuitka (factory)Construct ClosureVariableAccessTicks Construct ClosureVariableAccess 002000002000004000004000006000006000008000008000001000000100000012000001200000140000014000001600000160000018000001800000CPython 3.11Nuitka (main)Nuitka (develop)Nuitka (factory)184867889.78846153846155257.0CPython 3.11250088244.59615384615387470.6857704220571Nuitka (main)250258399.4038461538462470.6630462833025Nuitka (develop)250258554.2115384615385470.6630462833025Nuitka (factory)Construct ClosureVariableAccessTicks Construct ClosureVariableAccess 0020000020000040000040000060000060000080000080000010000001000000120000012000001400000140000016000001600000180000018000002000000200000022000002200000240000024000002600000260000028000002800000CPython 3.10Nuitka (main)Nuitka (develop)Nuitka (factory)284856889.78846153846155257.0CPython 3.10250000244.59615384615387482.4276993806119Nuitka (main)250001399.4038461538462482.42761262987096Nuitka (develop)250001554.2115384615385482.42761262987096Nuitka (factory)Construct ClosureVariableAccessTicks Construct ClosureVariableAccess 0010000001000000200000020000003000000300000040000004000000CPython 2.7Nuitka (main)Nuitka (develop)Nuitka (factory)456327589.78846153846155257.0CPython 2.7200000244.59615384615387493.284769120356Nuitka (main)250087399.4038461538462490.5724039288585Nuitka (develop)250087554.2115384615385490.5724039288585Nuitka (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.