bksahu's Blog

Blog post #1

Published: 06/09/2019

Hello everyone! Welcome to my first blog post.

There are a total of 69 built-ins in Python 3 and ​76 built-in in Python 2 out of which 27 built-ins are yet to be optimized in Nuitka​. My aim is to optimize those missing built-ins in Nuitka. This will make Nuitka a lot faster while working with CPython built-ins.

The first built-in that I'm going to start with is "any" built-in. I have already implemented a generic algorithm for the optimization for cases like any([0] * 10000). But there is problem with this algorithm i.e it doesn't have support for Dict and Sets datatypes because they are non-indexable. A solution to problem is embracing the fact that python internally uses iter() and next() while working with loops. Using these we can easily iterate over the elements in the dictionary and set datatypes. The idea is to have a limit for the number of elements we will iterate through and try to predict the True value, for example any([0]) or any([0]*100) is always going to be False. In the same way any([0]*1000000) is also False but it's too expensive to iterate of all the million elements and find their truth value that's why we need to a limit. This solutions will also be helpful with future optimization that need to iterate through every element.


Thank you for reading :)

View Blog Post

Optimizing "all" - Weekly Check-in #1

Published: 06/02/2019

Welcome to my second weekly check-in!

1. What did you do this week?

  • optimized the "all" built-in
  • refractored the "IterationHandles" class

2. What is coming up next?

Next up, I will be working on adding support for "abs" built-in after discussing potential optimizations with my mentors.

3. Did you get stuck anywhere?

No nowhere because all built-in is almost similar to any built-in.


Thank you for reading!

Batakrishna Sahu

View Blog Post

Welcome blog post

Published: 05/28/2019

Hello, world. Welcome to my first of many upcoming blog posts. I will be working on optimizing Python 2 and Python 3 built-ins for Nuitka this summer.  

Thank you for stopping by!

Batakrishna Sahu

View Blog Post