Connect with us

Technology

Pyston returns to open source, Facebook releases Cinder, or should devs just use PyPy? • The Register

Voice Of EU

Published

on

Facebook has released Cinder, used internally in Instagram to improve Python performance, while another faster Python, called Pyston, has released version 2.2 and made the project open source (again).

Python is the world’s second most popular programming language (after JavaScript) according to some surveys; but it is by no means the fastest. A glance at benchmarks tells us that Python 3 computation is often many times slower than compiled languages like C and Go, or JIT (Just-in-Time) compiled languages like Java and JavaScript.

One reason is that the official implementation of Python, called CPython, is an interpreted, dynamic language, and its creator Guido Van Rossum has resisted optimising it for performance, saying in 2014 that “Python is about having the simplest, dumbest compiler imaginable, and the official runtime semantics actively discourage cleverness in the compiler like parallelizing loops or turning recursion into loops.”

He argued that Python developers should write performance-critical code in C or use a JIT-compiled implementation like PyPy, which claims to be on average 4.2 times faster than CPython – though there are some differences between PyPy and CPython.

The demand for faster Python though has inspired some other projects: Facebook has released Cinder as open source, a project described as “Instagram’s internal performance-oriented production version of CPython 3.8.” Optimizations in Cinder include “bytecode inline caching, eager evaluation of coroutines, a method-at-a-time JIT, and an experimental bytecode compiler.”

The Cinder JIT “supports almost all Python opcodes, and can achieve 1.5-4x speed improvements,” according to the documents.

Facebook emphasises that although it runs Cinder in production, the project “is not polished or documented for anyone else’s use,” and specifically refuses to commit to fixing reported bugs or providing any support.

Another limitation is that Cinder is only used on x64 Linux, and “anything else (including OS X) probably won’t work.” At the same time, the team said that “our goal in making this code available is a unified faster CPython.”

There does seem to be an element of pushing the code out and hoping that others will pick it up and make it something more useful to the Python community.

One important aspect of Cinder is the use of “Static Python,” which sounds like a contradiction since Python is a dynamic language. The idea is to add type annotation to Python code so that normal Python syntax can be compiled to type-checked bytecode by the Cinder compiler, enabling better optimization. Performance, says the team, is similar to Cython modules, where Cython is a static compiler for Python and C.

Dropbox is another high profile company which once used Python heavily but wanted better performance, and in 2014 came up with Pyston, saying at the time that “hitting our performance targets can sometimes become prohibitively difficult when staying on Python.”

Pyston is a method-at-a-time JIT, whereas PyPy is a tracing JIT, meaning that it traces through the code to optimize specific code paths and loops, rather than simply compiling each method.

In 2017 Dropbox ended its involvement with Pyston, writing its performance-critical code in other languages such as Go instead. Kevin Modzelewski, formerly a principal engineer at Dropbox, founded an independent Pyston project. Pyston 2 was rewritten and released as a binary, but Modzelewski said that “since compiler projects are expensive and we no longer have benevolent corporate sponsorship, it is currently closed-source while we iron out our business model.”

Performance issues?

Those business challenges have now been overcome, since Pyston 2.2 is now available and is open source. Pyston 2.2 is “30 per cent faster than stock Python on our web server benchmarks,” Modzelewski said, adding that “Pyston can thrive on an open-source business model, primarily by starting with support services.”

The project aims to be highly compatible, so that it is a drop-in replacement for CPython – provided it is on an x86-64 system, as other architectures are not supported. Compatibility includes CPython C extensions. Benchmarks here show Pyston improving on CPython 3.8 in most cases, often substantially, but not to the same extent as PyPy. The trade off appears to be compatibility versus performance.

In May 2020 AI specialists DLabs tested JavaScript versus Python performance for machine learning. For JavaScript Node 12.16.1 was used, and for Python 3.7.6. The results seem surprising: although JavaScript benefits from an excellent JIT in Node (which uses the V8 engine as used by Google Chrome), Python easily outperformed it. “The learnings from the tests I ran are stark. JavaScript couldn’t get close to Python’s tasks — across the board. JavaScript’s computational performance is still much better than Python’s. However, the maturity of the libraries — which often have underlying modules written in C — means that operations on large datasets can offer so much more than sheer computational power,” said developer Krzysztof Miśtal.

Perhaps Pyston would have been even quicker; but Miśtal’s experience demonstrates that Python performance is not always a problem, since library developers have followed Van Rossum’s advice and written performance-critical code in C. Those using Python for general purposes are likely to get more benefit. ®

Source link

Technology

I can’t charge my electric car cheaply because I’m too close to an RAF base | Money

Voice Of EU

Published

on

A few months ago I decided to switch energy supplier and moved to Octopus Energy’s Go tariff, principally because it offers cheap electric car charging overnight at a rate of 5p/kWh.

I applied to have the required smart meter installed. But after being given a date, I was later declined on the basis that smart meters cannot work at my address because they interfere with the missile early warning system at RAF Fylingdales.

Initially, I thought this was a joke. I have been involved with the construction of hundreds of new homes in Teesside, all of which have had smart meters installed.

Smart Energy GB, the body responsible for the rollout, has confirmed that this is very real, and smart meters installed in the area will not have had their smart capacity turned on.

I was told that a new meter is being worked upon and will eventually replace those already installed.

Meanwhile, I am having to charge my car at a premium rate of 16.76p/kWh which is costing me about £26 more a week than it would be on the Go tariff.

AM, Guisborough

Given that your house is more than 20 miles from the RAF base in question, I, too, was amazed that this could be an issue, but it is – and also in other areas close to bases.

Smart Meter GB has confirmed this is the case and says it is working on a solution – a communications hub that will enable people living near sensitive RAF sites to use smart meters.

It says these will be offered to customers “in the coming months”.

It adds those in the affected area, who had already had smart meters installed should be able to have the hubs retrofitted.

Meanwhile, Octopus has come up with a solution for your problem. It has offered to add you to the trial of these new meters, which, in turn, will allow you to go on the Go tariff.

It says it hopes to install your new meter before Christmas. It has also said that if you get the log from your charging firm, showing how much electricity you have used for the car since the switch took place, it will retroactively apply the savings that you would have gained had the smart meter worked from the start – a generous offer.

We welcome letters but cannot answer individually. Email consumer.champions@theguardian.com or write to Guardian, 90 York Way, London N1 9GU. Include a phone number. Letters are subject to our terms: gu.com/letters-terms

Source link

Continue Reading

Technology

China’s Yutu rover spots ‘mysterious hut’ on far side of the Moon

Voice Of EU

Published

on

Cube-shaped object is probably just a rock. Yutu will check it out anyway

China’s Moon rover, Yutu 2, has sent images of a strangely geometric object.…

Source link

Continue Reading

Technology

Strikepay struck gold at National Startup Awards 2021

Voice Of EU

Published

on

Strikepay, founded by fintech entrepreneurs Oli Cavanagh and Charles Dowd, scooped the top award for its fast-growing cash-free tipping tech.

Irish fintech company Strikepay has scooped the top prize at this year’s National Startup Awards.

The start-up, previously called Strike, was founded in 2020 to enable cash-free tipping without the need for a payment terminal or a new app on a customer’s phone.

Its founders, fintech entrepreneurs Oli Cavanagh and Charles Dowd, raised €625,000 in seed funding earlier this year and said they intended to seek a further €6.5m in investment by the end of 2021.

Strikepay has already begun acquiring and collaborating with other companies to bolster its product offering. In June, it acquired UK payments rival Gratsi and in April it appointed former Just Eat exec Edel Kinane as its chief growth officer.

Earlier in the year, it teamed up with Camile Thai Kitchen to enable contactless tipping for food delivery drivers and partnered with mobility company Bolt to bring its cashless tipping technology to taxis in Dublin.

Strikepay was one of several winners at the awards ceremony, which was livestreamed last night (2 December).

Other winners included health-tech start-up Stimul.ai, customer analysis tech business Glimpse, and sheep monitoring start-up Cotter Agritech, which has been participating in a new accelerator programme at University College Dublin.

As well as taking the top award, Strikepay also won Best Fintech Startup.

This year marked the 10th year of the National Startup Awards. The event was sponsored by Enterprise Ireland, Microfinance Ireland, Sage, Cronin Accountants and McCann Fitzgerald.

Last year’s top award was given to drone delivery service Manna. The start-up had been working with companies such as Tesco, Just Eat and Camile Thai to test its drones, and has seen further growth since then.

The full list of winners at the 2021 awards, in order of gold, silver and bronze, are:

Startup of the Year 2021

Strikepay

Early Stage Startup

Imvizar, CyberPie, The Fifth Dimension

Emerge Tech Startup

Xunison, Helgen Technologies, LiveCosts.com

Fintech Startup

Strikepay, ID-Pal, Itus Secure Technologies

Food and Drink Startup

Fiid, SiSú, Thanks Plants

Social or Sustainable Startup

Altra, Peer, Fifty Shades Greener

Product and Manufacturing Startup

Cotter Agritech, Orca Board, Filter

E-commerce and Retail Startup

FinalBend, The Book Resort, Nufields

Tech Startup

Glimpse, LegitFit, Examfly

Medtech Startup

Stumul.ai, SymPhysis Medical, Bonafi

Covid Pivot or Response Startup

Zoom Party/Find A Venue, KSH Group, Streat School

Don’t miss out on the knowledge you need to succeed. Sign up for the Daily Brief, Silicon Republic’s digest of need-to-know sci-tech news.

Source link

Continue Reading

Trending

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates 
directly on your inbox.

You have Successfully Subscribed!