Construct ClosureVariableAccess

Performance Diagrams

Construct ClosureVariableAccess 0020000020000040000040000060000060000080000080000010000001000000120000012000001400000140000016000001600000180000018000002000000200000022000002200000CPython 3.12Nuitka (main)Nuitka (develop)Nuitka (factory)234863289.78846153846155257.0CPython 3.12400000244.59615384615387462.0286916612931Nuitka (main)250000399.4038461538462477.81120151907743Nuitka (develop)250000554.2115384615385477.81120151907743Nuitka (factory)Construct ClosureVariableAccessTicks Construct ClosureVariableAccess 002000002000004000004000006000006000008000008000001000000100000012000001200000140000014000001600000160000018000001800000CPython 3.11Nuitka (main)Nuitka (develop)Nuitka (factory)184884689.78846153846155257.0CPython 3.11250000244.59615384615387470.7005701019821Nuitka (main)100110399.4038461538462490.7347562916377Nuitka (develop)99952554.2115384615385490.7558744544102Nuitka (factory)Construct ClosureVariableAccessTicks Construct ClosureVariableAccess 0020000020000040000040000060000060000080000080000010000001000000120000012000001400000140000016000001600000180000018000002000000200000022000002200000CPython 3.10Nuitka (main)Nuitka (develop)Nuitka (factory)229897589.78846153846155257.0CPython 3.10250000244.59615384615387477.2430410040595Nuitka (main)100000399.4038461538462493.3664471708546Nuitka (develop)100000554.2115384615385493.3664471708546Nuitka (factory)Construct ClosureVariableAccessTicks Construct ClosureVariableAccess 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000CPython 3.8Nuitka (main)Nuitka (develop)Nuitka (factory)842372989.78846153846155257.0CPython 3.84650365244.59615384615387367.6940045381144Nuitka (main)4650444399.4038461538462367.6916870234621Nuitka (develop)5000093554.2115384615385357.4345138504666Nuitka (factory)Construct ClosureVariableAccessTicks Construct ClosureVariableAccess 0010000001000000200000020000003000000300000040000004000000CPython 2.7Nuitka (main)Nuitka (develop)Nuitka (factory)446381789.78846153846155257.0CPython 2.7350000244.59615384615387484.73950414909655Nuitka (main)300000399.4038461538462487.507487072852Nuitka (develop)300000554.2115384615385487.507487072852Nuitka (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.