Skip to main content

A fast memory optimization extension for Python

Project description

FastPyX 🚀

FastPyX is a high-performance C extension for Python, designed to optimize memory usage and significantly improve execution speed.

Why FastPyX?

🔥 Faster than Python's built-in list for fappend operations
📉 Uses up to 56% less memory than Python lists
Ideal for high-performance applications requiring optimized data structures

Features

  • 🚀 Written in C for extreme performance
  • 📌 Optimized FastList implementation (efficient fappend method)
  • 🔹 Supports multiple data types seamlessly
  • 🔧 Efficient memory allocation to reduce fragmentation
  • 🔄 Convert to Python list (to_list) for compatibility
  • 📊 Fast random access (fget) and optimized length retrieval (len())

Installation

To install FastPyX:

pip install fastpyx  

Usage

import fastpyx  

fl = fastpyx.FastList()

# Append values  
for i in range(10):  
    fl.fappend(i)

# Print all elements  
fl.fprint()

# Access an element  
index = 5  
value = fl.fget(index)  
print(f"Index {index}: {value}")

# Convert to Python list  
py_list = fl.to_list()  
print("Converted list:", py_list)

# Get length  
print("Length:", len(fl))

Benchmark Results

Operation FastList Python List Speedup Memory Usage (10M items)
fappend 0.56s 0.67s 🔥 17% Faster 30.5MB (FastList) vs. 69MB (Python List)
fget 0.0067s 0.0062s Slightly slower (needs optimization) -
to_list 0.8999s 0.124s Needs improvement -

FastList is both faster and more memory-efficient than Python's built-in list!


📜 License

MIT License. Feel free to contribute and improve FastPyX!


🔗 Future Roadmap

✅ Optimize to_list performance
✅ Add slicing support
✅ Implement iterator support for better compatibility
✅ Advanced memory management optimizations for Django and other frameworks
✅ Additional performance improvements for lists, dictionaries, and sets
✅ More Pythonic API and integration with NumPy/Pandas

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastpyx-0.5.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastpyx-0.5.4-cp312-cp312-win_amd64.whl (8.7 kB view details)

Uploaded CPython 3.12Windows x86-64

File details

Details for the file fastpyx-0.5.4.tar.gz.

File metadata

  • Download URL: fastpyx-0.5.4.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for fastpyx-0.5.4.tar.gz
Algorithm Hash digest
SHA256 047092bfaf6d8fdeee2eb266035b33b64118ea8c99ee60d63e5c4541cfb7579a
MD5 ac971a1f1bee56202e1db71b92eb4d96
BLAKE2b-256 55788f7e13089069da231723f8eeb9c238beb9ea937bd4835fe07bc580d0c50e

See more details on using hashes here.

File details

Details for the file fastpyx-0.5.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: fastpyx-0.5.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for fastpyx-0.5.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 32ab1b4b5b166ccccb2a77584d4fb458605f5f13eecfb053084aea2b5491d3f6
MD5 aa112e13024945bf4f905044834773e4
BLAKE2b-256 82ac7860594c8b0dde55c2194c24cc311286c2961bc1b8a91d748bb368e4e66e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page