Compilations was made in a Docker Ubuntu x64 image. There the results:
python3 -m nuitka --follow-imports -j 4 --plugin-enable=multiprocessing kapow.py
| name: Create Unstable Release | |
| on: | |
| push: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: |
| """ | |
| This file contains code for consuming the OpenAI API without depencies | |
| This code is released under MIT License. | |
| """ | |
| import json | |
| from typing import List | |
| import urllib.request as rq |
| class MetaMongo(type): | |
| def __call__(cls, *args, **kwargs): | |
| if "_id" in kwargs: | |
| _id = kwargs.pop("_id") | |
| o = super().__call__(*args, **kwargs) | |
| return o |
| # Usage example | |
| from scapy.all import * | |
| from scapy.layers.http import * | |
| sport, dport = detect_http_ports(rdpcap(pcap_file)) | |
| if sport: | |
| scapy.packet.bind_layers(TCP, HTTP, dport=dport) | |
| scapy.packet.bind_layers(TCP, HTTP, sport=sport) |
| class Serializable: | |
| def _clean_dict_(self, | |
| data = None, | |
| clean_or_raw: str = "clean") -> dict: | |
| # DICT | |
| if type(data) is dict: | |
| ret = {} |
| Number of elements: 10 | |
| ----------------------- | |
| Json Size: 0.02715015411376953 MB | |
| Json time: 0.006659951999999997 sec | |
| UJson time: 0.0030970319999999996 sec | |
| Pickle Size Proto 5: 0.02531909942626953 MB | |
| Pickle time Proto 5: 0.003745575000000001 sec | |
| Pickle Size Proto 4: 0.02531909942626953 MB | |
| Pickle time Proto 4: 0.0031195769999999984 sec |
| Number of elements: 10 | |
| ----------------------- | |
| Dict: 360 bytes # 636 bytes | |
| Namedtuple: 120 bytes # 396 bytes | |
| Class: 48 bytes # 1202 bytes | |
| Class Slots: 48 bytes # 556 bytes | |
| Dataclass: 48 bytes # 468 bytes |
| sudo apt-get update && apt-get -y install linux-image-extra-$(uname -r) | |
| sudo apt-get -y install apt-transport-https ca-certificates | |
| sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
| echo deb https://apt.dockerproject.org/repo ubuntu-xenial main > /etc/apt/sources.list.d/docker.list | |
| sudo apt-get update -y | |
| sudo apt-get purge -y lxc-docker | |
| sudo apt-get install -y docker-engine docker-compose | |
| sudo service docker start | |
| init 6 |
| # -*- coding: utf-8 -*- | |
| import asyncio | |
| @asyncio.coroutine | |
| def cmd_runner(cmd): | |
| # cmd = "ls" | |
| print(cmd) |