pygame on pypy usable

Hi,

TLDR; I'm at the pypy sprint, and working through the remaining pygame-on-pypy-cpyext issues.
https://youtu.be/WN1slc5O8os


Surprisingly to me... it's already usable. That is pygame (same one that runs on cpython), works on pypy through its C extension API. pypy has good support for the CPython API (through a recompile) now. PyPy is the python language with a fast JIT, so your code can approach C speeds. And in some cases it can be faster than C.

There was an issue with events stopping keyboard/mouse/etc from working. Lots of details in this issue describing the changes needed, so I hope other extensions encountering this will find it useful.
https://github.com/pygame/pygame/issues/419
But now that's fixed, every pygame app I tried on it has worked.

Cat sitting in the fog and snow of Switzerland

Why is this exciting?

This is exciting to me because:
  • pure python code being fast on pypy(after warmup), also mixed with the fast bits in C/asm.
  • cpyext is getting faster in pypy. There is already work and discussion towards it being faster than CPython.
  • maintaining one pygame code base is easier than maintaining several (pygame cffi/ctypes/cython, ...).
  • with one code base it should be fast on both pygame, and pypy(in time).
Here's our old pal solarwolf from early 2000s running on pypy.
https://youtu.be/WN1slc5O8os
Still lots of work to do (especially around PixelArray buffers and such). Then of course, there is the issue of binary wheels, so that  `pip install pygame`  works without needing to compile things from source.

How is the speed? (when do we use this tool? Is it fast enough?)

If your code is already quite well optimized, and not spending much time in python, you can't expect to see an improvement. However, if you are pushing boundaries in your python code, you can expect very good increases.

Some examples where you can expect it to be faster:
  • if profiling and a pygame function (like blit) isn't at the top of the slow bits.
  • collision detection (if you aren't using fancy algorithms).
  • a pure python ray caster.
  • writing a music synthesizer in python python.
Where it can be slower.
  • if you are going into C code for a lot of small operations. Like when using lots of pygame.Rect in a tight loop. This is because (currently) the cost of going from PyPy code into and out of CPython API code (like pygame) is a bit slow.
For me, I'm interested mostly in this for a physics art project which was really slow, and also for a software music synth written in pure python. Even more interesting is running pypy as a separate process for these tasks, and run the gui process with CPython.


Ray tracing 3D scenes. 

Here I run a python and pygame python ray tracer by Ian Mallett.

Ray Tracer to for realistic 3D lighting.

On PyPy - 18.6 seconds.
On Python 2.7 - 9 minutes, 28.1 seconds

That's 30x faster.  Making many more things possible in python - and at speed.


The fog has lifted at the Leysin pypy sprint.

Comments

Unknown said…
Very interesting post! How did you install pygame for pypy? I tried a pygame installation for pypy 6.0 (2.7) on windows and failed so far. I downloaded the wheel files for pygame 1.9.4 from pygame bitbucket using pypy -m pip install, but pypy refused to recognize them.
Do I have to install pygame-cffi or pygame?
Surbhi Sharma said…
Attempt office.com/setup which is extremely simple to install, download and recover. Utilization of it is additionally straightforward and the client can become familiar with the utilization of it without any problem. office.com/myaccount
Online Support&help alternative is likewise accessible in all application which gives a moment rule. office.com/setup Microsoft Office Setup is the complete bundle of Microsoft programs as it takes to the a variety of jobs, servers, office.com/setup and affiliations like PowerPoint, Excel, Word, Outlook, Publisher, OneNote, and Access.

Surbhi Sharma said…

Download norton antivirus to make your computer virus free with the best support and tech team. norton.com/setup Feel free to contact us. Norton web security is commonly used antivirus gives the least requesting to use and https://my.norton.com/home/setup most intutive affirmation for your PC and your mobiles .present it and negligence viruses,spyware,root-units - , Download norton 360 hackers. https://my.norton.com/home/setup for more nuances visit.

Surbhi Sharma said…

Go to Roku page record enter Roku com association code appeared on Roku TV. roku.com/link My Roku com associate not working use new Roku code.Roku is a streaming device, which is a reasonable roku setup and other Set-up Box. roku.com/link Roku is a bundle of amusement, where client can stream for boundless motion appears, web setup, news, roku.com/link animation and a lot more projects.

Giving users an unparalleled streaming experience, Team roku.com/link takes great pride in being the number one streaming service roku.com/link providers in the world.Sanction Roku associate, go to roku.com/link record enter Roku interface code appeared on Roku TV. My roku com interface not working use new Roku code. Roku.com/link To download click for more subtleties.

Surbhi Sharma said…
McAfee helps organizations orchestrate a truly integrated cyber environment that simultaneously protects, identifies and enhances security threats. mcafee.com/activate For consumers, McAfee protects your device at home and abroad from viruses, malware and other threats. mcafee antivirus is widely used aantivirus helps to detect and neutralize computer virus, mcafee.com/activate
the mail worms,the trojan programs,and also helps your system free of virus and other malware is quite a daily challenge. for more details visit mcafee.com/activate here.

Click mcafee.com/activate to redeem your product key. Enter the unique product key found on your Retail Card or eCard. mcafee.com/activate Follow our onscreen steps to download and install your security app.

Surbhi Sharma said…

Hulu supports a wide variety of devices that you can use to stream with us. enter hulu activation code You can activate any of them at any time, as well as remove them from your account. hulu.com/activate
Hulu Activation code will be on your TV when you open Hulu App. hulu.com/activate If your account required activation then it will display on your screen then use online.
Surbhi Sharma said…
Steps to Activate Avg retail enlistment Once you install AVG retail activation on your framework, you require to activate it as without activation it is extraordinary to get its feature. [avg.com/retail In this way, enact AVG antivirus by following given advances carefully.

System Mechanic is the essential PC performance package that helps you automatically fix and speed up your PC. system mechanic is the most effective way to restore and maintain maximum PC speed and stability.
Surbhi Sharma said…
The Canon, the famous brand has everything in it's variety starting from their cameras,canon.com/ijsetup to cinematography solutions to the scanner as well as printers – each single thing has its own specific productivity. Download from canon.com/ijsetup and setup on your device. Canon printers are all in one printer that facilitates print, copy and scan. ij.start.canon The canon printers are designed for personal as well as business use.Canon IJ Network Tool is a free application that allows you to install,ij.start.canon view or configure the network settings of the printer that is connected through a network.

Canon printer that can be downloaded via ij.start.canon page is the best wireless printer that you can connect to your device and print data smoothly. ij.start.canon Canon ijsetup CD is not the well-suited technique to use ij.start.canon setup installation for longer. One can also install from anther origin if your device is having issues in the online installation or any other.ij.start.canon Click download and start the canon ij setup downloading. On the completion, ij.start.canon double-tap on the downloaded file and start installation.
Surbhi Sharma said…

Canon.Com/ijsetup will manual you to Install Canon printer brand new updated drivers, ij.start.canon for Canon printer setup you could additionally visit ij.start.canon If we talk about printers the first name comes in our thoughts is Canon printer, on this internet site we will inform you a way to setup & deploy your ij.start.canon canon printer with little information approximately computers.

Canon ijsetup Before knowing about the process to connect the printer to the computer or other devices, ij.start.canon we can see about the canon ij setup. The ij.start.canon is the procedure to connect your printer to the other devices ij.start.canon using a wireless connection.Download drivers, software, firmware and manuals for your Canon Printer. ij.start.canon Online technical support, troubleshooting and how-to'

Surbhi Sharma said…

Visit ij.start.canon to download Canon printer drivers and software then install ij.start.canon and setup in your Windows & MAC Computer.ij.start.canon is the official Web address Provided By Canon So You can Download Driver, ij.start.canon Manual & Guides for your Canon Printer.

Here is a complete guide for the Canon Printer setup. ij.start.canon Follow the given process for hardware setup, ij.start.canon network configuration and printer driver installation.Download Canon Printer Drivers from ij.start.canon
then Install and setup your canon printer product by visiting canon ijsetup.
Surbhi Sharma said…
On Windows and MAC detailed guide for canon ij setup series printer with help of ij.start.canon a quick responsive information. canon.com/ijsetup IJ Start Canon Set Up & IJ Scan Utilities Software Configuration With Wireless ij.start.canon Support for Windows, Mac Os X, Linux and Android.

Norton Antivirus is an authorize program by ICSA Labs. comcast norton download Norton 360 download These Laboratories set up the prerequisites to be actualized for comcast norton the similarity of business security items.
Surbhi Sharma said…


Discover our Web Hosting platform, built for website speed. Start your project today. hosting Servers locations all around the world: USA, UK, the Netherlands, Brazil, and Singapore.Without hosting, no one can see your website. web hosting To get your website online, you need to marry up your hosting with a domain name and then upload your content.Hosting is what makes your site visible on the web. website hosting We offer fast, reliable plans for every need - from a basic blog to high-powered site.

Our AWS-based infrastructure offers the best speed and unlimited growth for your business. website hosting LiteSpeed Web Servers are faster than Apache and our LiteMage plugin provides PHP caching.We are the leaders in optimised web hosting. web hosting get upto 40x Faster web hosting & 99.99% Uptime Guarantee. 40x Fast Turbo Speed.A dedicated hosting service, dedicated server, or managed hosting service is a type of Internet hosting in which the client leases an entire server not shared with anyone else. dedicated server hosting This is more flexible than shared hosting, as organizations have full control over the server(s), including choice of operating system, hardware, etc.
Surbhi Sharma said…

Account.live.com/acsr is the direct URL to reset or change Microsoft password. account.live.com/acsr You have two options either using the search bar or through the search engine.Reset or recover your Microsoft account. Content provided by Microsoft. Applies to: Microsoft Account. Select Product Version. Before you begin . account.live.com/acsr You will need a working email account that you can access so we can send you information about your request. You can use any active email account, even one belonging to a friend or relative. Or, if you don’t have another email account that you can access, you.
Surbhi Sharma said…


To download Norton Security Online, you will need your Xfinity User ID and password. xfinity norton download Simply download Norton Security Online and enter your Xfinity User ID and password when asked. xfinity norton You will then also be prompted to create a Norton Account. Please enter in your information when prompted during Norton Security Online’s installation.Xfinity Authorize and xfinity norton is an official website that help users to activate Xfinity Gateway. User can get the best plans online for the Internet, video and mobile services too.xfinity norton download Get the package of entertainment by connecting with it and also get any services online whatever you need.

Surbhi Sharma said…

Amazon Prime Returns & Replacements Manage Your Content and Devices Amazon Assistant Help English United States. amazon.com/mytv Amazon Music Stream millions of songs: Amazon Advertising Find, attract, and engage customers: amazon.com/mytv Amazon Drive Cloud storage from Amazon: 6pm Score deals on fashion brands: AbeBooks Books, art & collectibles: amazon.com/mytv ACX Audiobook Publishing Made Easy: Alexa Actionable Analytics.

To perform the above activation process you need an Amazon Prime Video account. amazon.com/mytv You can create an account on prime video if you don’t have one and subscribe to watch Prime Video. amazon.com/mytv By this, you may also avail of prime Video 30-day free trial. amazon.com/mytv Let’s find out the steps that will help you in creating a prime video account:It is also available on a few selected set-top boxes at a cheaper cost. amazon.com/mytv GO to the home page of the Smart TV and search for Amazon Prime Video.

Surbhi Sharma said…
Amazon.com/mytv is considered one of the most reliable web portals for the activation of Prime Video on your Smart TV. Amazon.com/mytv After successful registration, choose a TV cable provider’s network, sign in to your account, Amazon.com/mytv and start watching excellent Amazon Prime content on your Smart TV device.Amazon.com/mytv Simply head on over to www.amazon.com/mytv enter code or primevideo.com/mytvand follow the on-screen instructions. Amazon.com/mytv Create an account on Amazon Prime Video from your TV official website and enjoy watching your favorite shows and great movies. Importnat Points to remember about Amazon.com/mytv amazon mytv.

Surbhi Sharma said…

Amazon.com/mytv is the most ideal website to activate the Amazon Prime Video subscription on users’ Smart TVs. Amazon.com/mytv Once the registration is done successfully, people can select their TV cable service provider,Amazon.com/mytv log in to their user account and enjoy their favorite Amazon Prime videos on the devices.Search your Smart TV’s app store or the Amazon Prime app.Amazon.com/mytv Download and add it to the channel. Open the app and Amazon.com/mytv click on amazon my tv the ‘Register on the Amazon website’ link.

Amazon is a video streaming service available for Amazon Prime members. Amazon.com/mytv With an eligible Amazon Prime membership, you have access to thousands of Amazon.com/mytv Prime Video titles at no additional cost.Enter the link Amazon.com/mytv on your browser. Input your login details to log in to your Amazon Prime video account. Amazon.com/mytv A new screen will open which will ask for the “ Amazon Prime Verification Code .
Surbhi Sharma said…

Start now and set up Amazon Prime Video on your devices. Amazon.com/mytv Register your Smart TV, streaming media player, or any other device to watch now thousands of movies and videos in HD quality. Amazon.com/mytv Amazon Mytv Enter Code For Tv Registration now offers you several coupons to save money. Amazon.com/mytv If you want to take full advantage of your Amazon Prime account please link it to your TV and thank us later. Amazon.com/mytv Simply head on over to amazonmytv.

Amazon Prime Video administration on your Smart TV or gushing gadget ought to be effective. Amazon.com/mytv This gives you boundless access to huge amounts of films and TV appears, both for yourself and your friends and family. Amazon.com/mytv the actuation procedure is so basic and clear that everybody can enact Amazon Prime Video on and is the best site to initiate the Amazon Prime Video membership on clients' Smart TVs. Amazon.com/mytv When the enrollment is done effectively, individuals can choose their TV link specialist organization, sign in to their client account and make the most Amazon.com/mytv of their preferred Amazon Prime recordings on the gadgets.

Surbhi Sharma said…

Open the Amazon app on your TV. Amazon.com/mytv Sign in with your newly created Amazon Prime account. Amazon.com/mytv There will be a 6 letter code on your TV screen. Enter the code shown on the TV screen in the activation window on your PC. Amazon.com/mytv If you are a person whose eyes open wide when finding new TV shows or movies to watch, then Amazon Prime is just for you. If you are a person whose eyes open wide when finding new TV shows or movies to watch, then Amazon Prime is just for you. Amazon.com/mytv Amazon Prime Video is a streaming services provided to Amazon Prime members. Amazon.com/mytv click here. How to activate Amazon prime on TV using .Amazon Prime is the largest distributor of films, web series, drams etc in the world.
Surbhi Sharma said…
This comment has been removed by the author.
Surbhi Sharma said…


Amazon account, if you already have an account then sign in to your account. Amazon.com/mytv Now enter the activation or verification code in the next screen Amazon.com/mytv that is in front of you. [url=https://tvamazon.vmytv.com]Amazon.com/mytv[/url] Enjoy exclusive Amazon Originals as well as popular movies and TV shows. Amazon.com/mytv Watch anytime, anywhere. Start your free trial.

Now, you need to sign in to your Amazon.com/mytv account on the off chance that you as of now have a record with Amazon.com/mytv Amazon or you rapidly make another record. Amazon.com/mytv Once done, go ahead “Proceed” to send the record “confirmation code” to your telephone. Amazon.com/mytv You can also register any device such as smart tv, android tv, android devices with prime videos easi;y Amazon.com/mytv using the Amazon mytv codeat amazon mytv.

Surbhi Sharma said…

Amazon Prime is a subscription-based platform that gives Amazon.com/mytv access to the users of a large range of services such as unlimited video. Amazon.com/mytv Amazon prime movie is available on almost all streaming devices such as Amazon.com/mytv Roku, Amazon Fire TV, Chromecast, and many more.

www.amazon.com/mytv enter code Know Complete Process to Activate Amazon.com/mytv Amazon Prime Follow Simple Instructions and get www.amazon.com/mytv.Amazon.com/mytv Amazon, as an e-commerce platform, is increasingly popular. Amazon.com/mytv The brand has extended its tentacles into providing various services and media players.
Surbhi Sharma said…

Amazon Prime is a paid membership which gives you admittance to an primevideo.com/mytv enormous scope of administrations: primevideo.com/mytv Amazon Instant Video application on your LG TV or Blu-ray Player and then primevideo.com/mytv Prime Instant Video to start watching.

Prime Video gives you two ways to instantly stream Videos on your Android TV device. primevideo.com/mytv Buy or rent your favorite titles or join Amazon Prime and get unlimited access to award-winning Prime Originals as well as primevideo.com/mytv thousands of movies and TV shows at no additional cost. primevideo.com/mytv Install Prime Video on Your Devices Open your device's app store to download and install the Prime Video app. primevideo.com/mytv Open the Prime Video app. Register your device – select Register on the Amazon website, where you are given a code to enter. Some devices allow.

Surbhi Sharma said…
Prime Video was previously called Amazon Video and primevideo.com/mytv
before that it was called Amazon Instant Video. primevideo.com/mytv Through Amazon Prime you can enjoy new and old movies and TV service. primevideo.com/mytv Amazon Prime is very well known for its name as well as its services.  primevideo.com/mytv Amazon Prime is the best American Internet video on demand service.

Using a computer, go to primevideo.com/mytv Sign-in with an active e-mail address and password or click Create your Amazon account. primevideo.com/mytv Prime Video gives you two ways to instantly stream Videos on your Android TV device. primevideo.com/mytv Buy or rent your favorite titles or join Amazon Prime and get unlimited access to award-winning Prime Originals as well as thousands of movies and TV shows at no additional cost. primevideo.com/mytv Browse titles, search for your favorites, or enjoy movies and shows recommended.

Surbhi Sharma said…

Directory of HP support and additional resource information. Get assistance for: drivers, downloads, software updates, patches, find authorized support providers, replacement parts, 123.hp.com/setup product registration, HP training and education, service centers, forums and community, warranty, and contact information. 123.hp.com/setup click here. Wireless Setup For HP Wireless Printer Setup, follow these option to connect with the printer. Connect your printer with the wireless router. 123.hp.com/setup On this website you can find directions on how you can connect your wirelessly, with help of USB cable and even things like how one can install a cartridge in the printer.
Thanks for sharing this blog here.
Get instant solution to activate roku streaming device using Roku Com Link .

Visit us.
Slot said…
ให้กำลังใจ
สมัคร สล็อต

Popular posts from this blog

Draft 3 of, ^Let's write a unit test!^

Is PostgreSQL good enough?

post modern C tooling - draft 6