|
12 | 12 | "\n", |
13 | 13 | "This guide covers the following recommendations:\n", |
14 | 14 | "\n", |
15 | | - "⏲️ **Use profiling tools** to find and assess performance bottlenecks. \n", |
16 | | - "🔁 **Replace for-loops** by built-in functions and efficient external implementations. \n", |
17 | | - "📝 **Consider algorithmic performance**, not only implementation performance. \n", |
18 | | - "🧊 **Get familiar with NumPy:** vectorized functions, slicing, masks and broadcasting. \n", |
19 | | - "⚫ **Miscellaneous:** sparse arrays, Numba, parallelization, huge files (xarray), memory. \n", |
| 15 | + "⏲️ **Use profiling tools** to find and assess performance bottlenecks.\n", |
| 16 | + "🔁 **Replace for-loops** by built-in functions and efficient external implementations.\n", |
| 17 | + "📝 **Consider algorithmic performance**, not only implementation performance.\n", |
| 18 | + "🧊 **Get familiar with NumPy:** vectorized functions, slicing, masks and broadcasting.\n", |
| 19 | + "⚫ **Miscellaneous:** sparse arrays, Numba, parallelization, huge files (xarray), memory, pickle format.\n", |
20 | 20 | "⚠️ **Don't over-optimize** at the expense of readability and usability." |
21 | 21 | ] |
22 | 22 | }, |
23 | 23 | { |
24 | 24 | "cell_type": "markdown", |
| 25 | + "id": "33f970c4", |
25 | 26 | "metadata": { |
26 | 27 | "slideshow": { |
27 | 28 | "slide_type": "slide" |
|
1095 | 1096 | }, |
1096 | 1097 | { |
1097 | 1098 | "cell_type": "markdown", |
| 1099 | + "id": "0ca35e9e", |
| 1100 | + "metadata": { |
| 1101 | + "slideshow": { |
| 1102 | + "slide_type": "slide" |
| 1103 | + } |
| 1104 | + }, |
| 1105 | + "source": [ |
| 1106 | + "(saving-with-pickle)=\n", |
| 1107 | + "### Using pickle to save python objects\n", |
| 1108 | + "`pickle` is the standard python library [serialization module](https://docs.python.org/3/library/pickle.html).\n", |
| 1109 | + "It has the nice feature of being able to save most of python objects (standard and user defined) using simple methods.\n", |
| 1110 | + "However, pickle is *transient*, i.e. it has limited Portability: Pickle files are specific to the Python environment they were created in. This means that Pickle files may not be compatible across different Python versions or environments, which can make it challenging to share data between systems. As such it should only be used for temporary storage and not for persistent one." |
| 1111 | + ] |
| 1112 | + }, |
| 1113 | + { |
| 1114 | + "cell_type": "markdown", |
| 1115 | + "id": "de8dca2c", |
1098 | 1116 | "metadata": { |
1099 | 1117 | "slideshow": { |
1100 | 1118 | "slide_type": "slide" |
|
0 commit comments