Construct DictCreation

Performance Diagrams

Construct DictCreation 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000CPython 3.12Nuitka (main)Nuitka (develop)Nuitka (factory)1432862288.95192307692307290.6791046769954CPython 3.1213030000242.31730769230768310.0231175713373Nuitka (main)16589602395.6826923076923257.0Nuitka (develop)16429600549.0480769230769259.3833577061843Nuitka (factory)Construct DictCreationTicks Construct DictCreation 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000100000001000000011000000110000001200000012000000CPython 3.11Nuitka (main)Nuitka (develop)Nuitka (factory)1228942788.95192307692307257.0CPython 3.1110260000242.31730769230768297.80764983215624Nuitka (main)11000000395.6826923076923282.9277547308318Nuitka (develop)11000000549.0480769230769282.9277547308318Nuitka (factory)Construct DictCreationTicks Construct DictCreation 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000100000001000000011000000110000001200000012000000CPython 3.10Nuitka (main)Nuitka (develop)Nuitka (factory)1230878088.95192307692307257.0CPython 3.108590000242.31730769230768331.65953165139035Nuitka (main)10731457395.6826923076923288.66688979798914Nuitka (develop)10611457549.0480769230769291.0760518882894Nuitka (factory)Construct DictCreationTicks Construct DictCreation 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000900000090000001000000010000000CPython 2.7Nuitka (main)Nuitka (develop)Nuitka (factory)1043269288.95192307692307257.0CPython 2.76560119242.31730769230768348.72822952562524Nuitka (main)6270119395.6826923076923355.59735415218006Nuitka (develop)6180119549.0480769230769357.7291514500764Nuitka (factory)Construct DictCreationTicks

Source Code with Construct

    dict_val3 = module_value3
    dict_val4 = module_value4

    l = 1

    if cond:
        l = {
            dict_key1: dict_val1,
            dict_key2: dict_val2,
            dict_key3: dict_val3,
            dict_key4: dict_val4,
        }

    return (
        l,
        dict_val1,
        dict_val2,
        dict_val3,
        dict_val4,
        dict_key1,
        dict_key2,
        dict_key3,
        dict_key4,
    )


for x in itertools.repeat(None, 10000):
    # 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

    dict_val3 = module_value3
    dict_val4 = module_value4

    l = 1

    if cond:
        l = {
            dict_key1: dict_val1,
            dict_key2: dict_val2,
            dict_key3: dict_val3,
            dict_key4: dict_val4,
        }

    return (
        l,
        dict_val1,
        dict_val2,
        dict_val3,
        dict_val4,
        dict_key1,
        dict_key2,
        dict_key3,
        dict_key4,
    )


for x in itertools.repeat(None, 10000):
    # 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.