Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a05229c

Browse filesBrowse files
committed
update gc nb
1 parent 5e9f544 commit a05229c
Copy full SHA for a05229c

File tree

Expand file treeCollapse file tree

1 file changed

+78
-22
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+78
-22
lines changed

‎examples/garbage_collection.ipynb

Copy file name to clipboardExpand all lines: examples/garbage_collection.ipynb
+78-22Lines changed: 78 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,93 +23,147 @@
2323
"cell_type": "code",
2424
"execution_count": null,
2525
"id": "1bb6bc6f-7786-4d23-9eb1-e30bbc66c798",
26-
"metadata": {},
26+
"metadata": {
27+
"tags": []
28+
},
2729
"outputs": [],
2830
"source": [
29-
"print(process.memory_info().rss / 1024 / 1024)"
31+
"def print_process_ram_mb():\n",
32+
" print(process.memory_info().rss / 1024 / 1024)"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": null,
38+
"id": "b376676e-a7fe-4424-9ba6-fde5be03b649",
39+
"metadata": {
40+
"tags": []
41+
},
42+
"outputs": [],
43+
"source": [
44+
"print_process_ram_mb()"
3045
]
3146
},
3247
{
3348
"cell_type": "code",
3449
"execution_count": null,
3550
"id": "b23ba640-88ec-40d9-b53c-c8cbb3e39b0b",
36-
"metadata": {},
51+
"metadata": {
52+
"tags": []
53+
},
3754
"outputs": [],
3855
"source": [
3956
"plot = Plot()\n",
40-
"\n",
41-
"# a = np.random.rand(5_000_000)\n",
42-
"# plot.add_line(a)\n",
43-
"\n",
44-
"\n",
4557
"plot.show()"
4658
]
4759
},
4860
{
4961
"cell_type": "code",
5062
"execution_count": null,
5163
"id": "17f46f21-b29d-4dd3-9496-989bbb240f50",
52-
"metadata": {},
64+
"metadata": {
65+
"tags": []
66+
},
5367
"outputs": [],
5468
"source": [
55-
"print(process.memory_info().rss / 1024 / 1024)"
69+
"print_process_ram_mb()"
5670
]
5771
},
5872
{
5973
"cell_type": "code",
6074
"execution_count": null,
6175
"id": "e26d392f-6afd-4e89-a685-d618065d3caf",
62-
"metadata": {},
76+
"metadata": {
77+
"tags": []
78+
},
6379
"outputs": [],
6480
"source": [
65-
"a = np.random.rand(1_000, 5_000)"
81+
"# for line\n",
82+
"# a = np.random.rand(10_000_000)\n",
83+
"\n",
84+
"# for heatmap\n",
85+
"# a = np.random.rand(20_000, 20_000)\n",
86+
"\n",
87+
"# for line collection\n",
88+
"# a = np.random.rand(500, 50_000)\n",
89+
"\n",
90+
"# for image\n",
91+
"# a = np.random.rand(7_000, 7_000)\n",
92+
"\n",
93+
"# for scatter\n",
94+
"a = np.random.rand(10_000_000, 3)"
6695
]
6796
},
6897
{
6998
"cell_type": "code",
7099
"execution_count": null,
71100
"id": "31e3027a-56cf-4f7b-ba78-aed4f78eef47",
72-
"metadata": {},
101+
"metadata": {
102+
"tags": []
103+
},
73104
"outputs": [],
74105
"source": [
75-
"print(process.memory_info().rss / 1024 / 1024)"
106+
"print_process_ram_mb()"
76107
]
77108
},
78109
{
79110
"cell_type": "code",
80111
"execution_count": null,
81112
"id": "9cf2ceaa-5b01-4e12-be39-f267cd355833",
82-
"metadata": {},
113+
"metadata": {
114+
"tags": []
115+
},
83116
"outputs": [],
84117
"source": [
85-
"plot.add_line_stack(a)"
118+
"# g = plot.add_line_collection(a)\n",
119+
"# g = plot.add_heatmap(a)\n",
120+
"# g = plot.add_line(a)\n",
121+
"g = plot.add_scatter(a)"
86122
]
87123
},
88124
{
89125
"cell_type": "code",
90126
"execution_count": null,
91-
"id": "53170858-ae72-4451-8647-7d5b1f9da75e",
92-
"metadata": {},
127+
"id": "6518795c-98cf-405d-94ab-786ac3b2e1d6",
128+
"metadata": {
129+
"tags": []
130+
},
93131
"outputs": [],
94132
"source": [
95-
"print(process.memory_info().rss / 1024 / 1024)"
133+
"g"
96134
]
97135
},
98136
{
99137
"cell_type": "code",
100138
"execution_count": null,
101139
"id": "ee2481c9-82e3-4043-85fd-21a0cdf21187",
102-
"metadata": {},
140+
"metadata": {
141+
"tags": []
142+
},
103143
"outputs": [],
104144
"source": [
105145
"plot.auto_scale()"
106146
]
107147
},
148+
{
149+
"cell_type": "code",
150+
"execution_count": null,
151+
"id": "53170858-ae72-4451-8647-7d5b1f9da75e",
152+
"metadata": {
153+
"tags": []
154+
},
155+
"outputs": [],
156+
"source": [
157+
"print(process.memory_info().rss / 1024 / 1024)"
158+
]
159+
},
108160
{
109161
"cell_type": "code",
110162
"execution_count": null,
111163
"id": "e4e0f73b-c58a-40e7-acf5-07a1f70d2821",
112-
"metadata": {},
164+
"metadata": {
165+
"tags": []
166+
},
113167
"outputs": [],
114168
"source": [
115169
"plot.delete_graphic(plot.graphics[0])"
@@ -119,7 +173,9 @@
119173
"cell_type": "code",
120174
"execution_count": null,
121175
"id": "56c64498-229e-48b7-9fb1-f7c327fff2ae",
122-
"metadata": {},
176+
"metadata": {
177+
"tags": []
178+
},
123179
"outputs": [],
124180
"source": [
125181
"print(process.memory_info().rss / 1024 / 1024)"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.