# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # At the beginning of this video  
# 1. We were able to use @jit decorator in our Python code.

import numpy as np


def add_5(arr):
    arr += 5
    return arr


arr = np.random.random(55000000)

# %timeit add_5(arr)

# # Using Numba

# +
from numba import jit

@jit
def add_5_numba(arr):
    arr += 5
    return arr


# -

# %timeit add_5_numba(arr)

# # Using threads with Numba

@jit( parallel=True)
def add_5_numba_threads(arr):
    arr += 5
    return arr

# %timeit add_5_numba_threads(arr)

# # By the end of this video  
# 1. We will be able to use @jit decorator for parallelizing our Python Code.



StarcoderdataJupyterScriptsDedupFiltered