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).
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.”
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.
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. ®
Chinese software developers have crowdsourced a spreadsheet that dishes the dirt on working conditions at hundreds of employers.
Dubbed WorkingTime, the protest aims to offer transparency regarding how many work hours are expected. Many organisations expect 72-hour working weeks – an arrangement dubbed “996” after the 9am to 9pm, six days a week culture in place at many Chinese companies.
The practice has sometimes been promoted by the rich and famous: Alibaba’s Jack Ma publicly stated that employees should actually want to work long hours and a job you love enough to spend that much time doing is a “blessing”.
Chinese courts take a different view. A recent decision found 996-style hours aren’t permissible, as Chinese law caps overtime at 36 hours per month and requires compensation for the extra hours. But China is not a workers’ paradise, and the practice persists because oversight is limited and independent labour unions are illegal in the Middle Kingdom.
The WorkingTime project aims to assist developers looking for work to understand what they’re signing up for.
“The opacity of working hours in some companies, working time is a very important factor in choosing an offer,” wrote a movement founder on Chinese Q&A site Zhihu.
The spreadsheet in which workers record how many hours they work a week, job descriptions, breaks and other remarks strongly suggest that grueling hours remain at some workplaces. Others stick to a 40-ish hour working week and add perks like happy hours and subsidized housing.
The anecdotes, visible on an openly accessible spreadsheet associated with the project, provide a similar service for Chinese tech workers to web pages like Glassdoor – giving tips on company culture and requirements.
Some remarks include:
“I often go on business trips. I have been on business for half of a month. I leave work after 10 o’clock every night at the customer’s site. I have to work overtime on weekends. The entire department has worked for two years except for the leaders.”
“Feel free to ask for leave and lunch time, because it’s the field work, whether you are in the company or not, and you can play games casually, regardless of the leader. If you drink too much, it’s fine if you don’t come.”
“Mandatory to keep people on duty every night, compulsory all staff to work overtime every Saturday, no overtime pay, working hours over 10 hours.”
“When the daily work cannot be completed, it is necessary to work overtime at home.”
“The work pace is fast and the work content is highly saturated. Flexible commute, just do everything.”
The WorkingTime project has gone viral, with the founders reporting over ten million views and thousands of entries as of last Tuesday. While the founders remain anonymous, contributors hail from a diverse subset of companies that includes some of China’s big tech giants like Alibaba, Tencent, Huawei and Bytedance, as well as multinational companies such as SAP, Dyson, Intel and IBM.
According to the project’s GitHub page, lawyers are currently pitching in to sort out legal issues prior to making the project freely downloadable. However, a summary table of data collated daily is already available in Chinese.
Unsurprisingly, the project has stirred some ire. The founders have asked that participants do not apply for editing permission, explaining that “due to malicious editing” such privileges will not be granted. ®
The move comes following a power purchase agreement between Johnson & Johnson and Ørsted, which has windfarm sites in Clare and Kerry.
Johnson & Johnson has revealed plans to move to 100pc renewable electricity across its Irish operations.
The company has entered into an eight-year corporate power purchase agreement in Ireland with Danish company Ørsted. The agreement will help to ensure that the company’s entire Irish operations will be powered by electricity from 100pc renewable sources from now on.
Ørsted will supply the company with more than 1TWh of renewable energy during this period from two windfarms located in Kerry and Clare. The agreement will also help Ørsted as it invests in its strategy to construct more renewable generation in the future.
Taoiseach Micheál Martin, TD, praised the move in the context of Ireland’s climate action plans.
“Johnson & Johnson has embraced its environmental responsibilities globally, but also here in Ireland, and this agreement will help the company to achieve its wider climate goals. We are at a crucial point in the global fight against climate change and initiatives like this should become the benchmark for all companies to aspire to,” he said.
Towards net zero
Last year, Johnson & Johnson’s worldwide VP of environmental health, safety and sustainability, Paulette Frank, spoke at Silicon Republic’s Future Human event about the company’s “bold” climate goals. From her base in the US, Frank told attendees of the virtual event that her colleagues viewed the pandemic as “inspiration to propel” its climate action “further faster.”
Sourcing electricity from 100pc renewable sources is a goal the company set to achieve by 2025. By 2030, it wants to achieve carbon neutrality in its global operations.
John Lynch, plant leader at Johnson & Johnson Vision Care Ireland, said the company was proud to have met its targets in its Irish operations.
“Across our 10 sites and workforce of more than 5,000 here in Ireland, we are committed to supporting Johnson & Johnson’s climate action goals. In the last decade we have invested more than €60m in over 80 carbon footprint reduction projects.
“Today is a major landmark on our journey in Ireland to achieve net zero carbon emissions by 2030 and underlines our commitment to ensuring a better, healthier world.”
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.
Australians are the world’s biggest consumers of health and wellness apps, punching well above our per capita weight in our quest for peak physical and mental condition, according to research from telecommunications company Uswitch. In recent years we have also been making them – with everyone from fitness influencers to mental health advocacy groups launching digital products.
I’m partial to a bit of mobile-based movement and mindfulness myself, but I have a complex relationship with wellness. While I love green juices, pilates and my “ness” being “well”, I can’t abide many contemporary uses of the word. In the diet, fitness, fashion and other industries, “wellness” can feel like a barely repackaged “weight loss”, while “healthy” has replaced “slim” as companies respond superficially to the body positivity movement without really changing their ways.
Despite wholesome beginnings in the 1950s, wellness is often framed as a goal for the financially and genetically privileged – and don’t get me started on the pseudoscience.
So I choose cautious cynicism when engaging with wellness and wellbeing products – but I’ve also been alone in my house for the greater part of two years, so I’ll try pretty much anything.
Cost: $19.99 a month
Sweat is a women’s health app co-founded by Australian fitness influencer Kayla Itsines, who boasts a worldwide social media following of more than 40 million. It offers over 30 programs for training at home or the gym, including high-intensity interval training (Hiit), low-intensity training, yoga and barre.
I did sessions from the PWR Zero Equipment program and it was all easy to follow and very doable. Audio and written instructions and onscreen demonstrations are clear, and self-accountability is super easy. It’s perfect for lockdown and for busy people cramming in exercise wherever and whenever they can. Plus, I can report that burpees are still the merciless work of Satan herself.
Itsines has created an app that exists in the wellness space with little of the self-congratulatory, quasi-spiritual hoopla other influencers lean so heavily into. Sweat isn’t pretending to be something it’s not. It’s a workout app, you do workouts on it. Yes, there are recipes and lifestyle tips but they aren’t offered as miracle pathways to a higher plane of being.
Is it my preferred mode of exercise? No. But it’s convenient and flexible and I can see myself using it when I travel. If that’s a thing that ever happens again.
ReachOut’s WorryTime is an anxiety management app from the online youth mental health service that uses cognitive behavioural therapy (CBT) techniques to disrupt and manage repetitive thinking.
I am by no definition a youth, but I have mild anxiety and WorryTime’s methodology appealed to me. You nominate a daily time to do all your worrying and when you feel anxious, you note why in the app; every day at the designated time, you worry about what’s still plaguing you and delete what’s not. Easy!
I used WorryTime diligently for a while, noting my fears, my troubles and doubts and reassessing them every 24 hours. All was going well until I got busy with work, stressed about work and scared I’d stop getting work. Where the app had been a welcome task, it became a bugbear.
I was trying not to think about things that made me anxious and knowing the app contained a list of them created a classic avoidance paradigm. I skipped a day. And the next day. And the day after that. Soon the WorryTime alarm was causing me the very anxiety it was engaged to minimise. After a few weeks of this mental chicken-egg dance, I deleted the app. I may have been in the foetal position at the time.
I’m not advocating against WorryTime. It could be a great tool for others. There are no one-size-fits-all mental health salves. It would be nice if there were though.
Bibliotherapy with State Library Victoria
My favourite discovery from this whole exercise is bibliotherapy or book therapy, an age-old practice that uses literature to support better mental health and wellbeing. Basically, you read or are read aloud a prescribed text, specifically chosen to raise questions, uncover truths and encourage healing. It’s also fun to say.
In response to the pandemic, a new podcast called Bibliotherapy with State Library Victoria was launched. Hosted by bibliotherapy practitioner Dr Susan McLaine, it offers to help people “stay calmer in this fragile time”. In each episode, McLaine reads a short story and a poem and poses questions for listeners. Texts range from emerging and obscure writers to Tolstoy, Donne and Kipling.
I love this podcast. There’s something so intimate and soothing about being read to, no doubt embedded in childhood nostalgia. McLaine’s voice takes some getting used to, though to be fair I find this with most podcast hosts, but her choice of texts is excellent and she reads everything slowly and deliberately, “savouring every word and offering space between words”. It’s the closest thing to a hug I’ve had in months.
The only bad thing about it is that there are only two short seasons. After a brief search for similarly soporific, story-based podcasts and apps, I found the excellent Dreamy podcast, a collection of beautiful sleep stories by First Nations storytellers like Jazz Money and Aurora Liddle-Christie. Bringing tens of thousands of years of oral tradition into the digital world, Dreamy is “helping people of all walks of life to quiet their minds, drift into dreams, and disconnect from their devices”.
I also found Sleep Stories on the Calm app ($14.99 a month). It’s full of grown-up tales and mindful nonsense to soothe or bore you into slumber. There are even equally terrible and amazing celebrity cameos: Matthew McConaughey, Cillian Murphy and the hot duke from Bridgerton will read to you like you’re a child. Last night Harry Styles read me the worst poem I’ve ever heard – for 40 minutes. Five stars. Would listen again.
The Resilience Project
Price: $4.49 one time fee
The Resilience Project app is a “daily wellbeing journal” for all ages from a Melbourne-based organisation of the same name, providing evidence-based mental health strategies and “sharing the benefits of gratitude, empathy and mindfulness” to schools, sports clubs and businesses.
Users are encouraged to log on every day, note how they feel, record who or what they’re grateful for, perform acts of kindness and do a short guided meditation. This nice daily ritual only takes a few minutes but proves a small antidote to the current news cycle.
I don’t see myself using it long-term, because of repetitiveness and the world’s shortest attention span, but during this lockdown I’ve appreciated the nightly reminder to acknowledge my blessings and privilege and to reach out to friends.
Though it can’t do the heavy lifting where mental health is concerned, I’ll put it in my arsenal of chronic depression coping mechanisms, and try to use it in bad times. It won’t soothe what only drugs and Great British Bake Off can, but it might provide a few minutes respite.
Cost: $40 a month
The Class is an American exercise methodology-slash-mindfulness practice with semi-cult vibes, taught by a host of ridiculously hot and relentlessly cool twentysomethings who can pull off white Lycra and blend in on aGirlsset.
In fortuitous timing, founder Taryn Toomey launched online classes in late 2019, taking the Class into locked down homes around the world from 2020. Australians can access a wide selection of on-demand and live online classes, and there’s even an Australian teacher. Timezone differences narrow live options quite a bit, but most live classes become on-demand classes, so it doesn’t really matter.
Frequented by celebrities including Alicia Keys, Naomi Watts and Emma Stone, the Class is a mat-based, music-driven “cathartic workout experience” designed to “strengthen the body and balance the mind”. It’s yoga meets Les Mills meets clubbing. Movements are simple, repetition is key and loud exhales are encouraged. You may do squats for a whole song, free dance for another and star jumps for the next. In between, there’s stillness.
Teachers speak a kind of motivational psychobabble that is at once intolerable and addictive. It verges on the spiritual and flirts with cultural appropriation but remains just secular enough that I don’t turn it off. “Be in your power”; “You are enough”; “Softness is your birthright” and so on. Many teachers end their sessions with “I love you” which I somehow don’t hate.
At first, I struggled to put aside my prejudices against self-indulgent, pseudo-mystical wellness fads and find peace with beautiful women telling me to accept myself while making me do burpees. But the more I did it, the more I was able to just let go and roll with the theatre. Plus, it’s actually a very good workout.
I am now willingly paying for the Class. Let’s never speak of this again. I love you.