summaryrefslogblamecommitdiffstats
path: root/2023/info/gc-after.md
blob: d878219a05bfb0b2031927175f4741568f4fde6b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607


                                                                



























































































































































































































































































































































































































































































































































































































                                                                                                                                             
                                                                                                                                                                                                                             


                                            
<!-- Automatically generated by emacsconf-publish-after-page -->


<a name="gc-mainVideo-transcript"></a>
# Transcript


[[!template new="1" text="""Introduction""" start="00:00:00.000" video="mainVideo-gc" id="subtitle"]]

[[!template text="""Hello everyone, my name is Ihor Radchenko,""" start="00:00:00.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and you may know me from Org Mailing List.""" start="00:00:04.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""However, today I'm not going to talk about Org Mode.""" start="00:00:07.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Today I'm going to talk about""" start="00:00:09.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Emacs performance and how it's affected""" start="00:00:11.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""by its memory management code.""" start="00:00:14.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""First, I will introduce the basic concepts""" start="00:00:19.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""of Emacs memory management and what garbage collection is.""" start="00:00:21.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Then I will show you user statistics""" start="00:00:26.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""collected from volunteer users over the last half year""" start="00:00:30.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and I will end with some guidelines""" start="00:00:34.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""on how to tweak Emacs garbage collection customizations""" start="00:00:39.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to optimize Emacs performance""" start="00:00:44.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and when it's necessary or not to do.""" start="00:00:47.480" video="mainVideo-gc" id="subtitle"]]

[[!template new="1" text="""About garbage collection in Emacs""" start="00:00:51.080" video="mainVideo-gc" id="subtitle"]]

[[!template text="""Let's begin. What is garbage collection?""" start="00:00:51.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""To understand what is garbage collection,""" start="00:00:54.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""we need to realize that anything you do in Emacs""" start="00:00:56.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""is some kind of command. Any command is most likely""" start="00:00:59.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""running some Elisp code. Every time you run Elisp code,""" start="00:01:02.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you most likely need to locate certain memory in RAM.""" start="00:01:05.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Some of this memory is retained for a long time""" start="00:01:09.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and some of this memory is transient.""" start="00:01:12.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Of course, Emacs has to clear this transient memory""" start="00:01:15.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""from time to time, to not occupy all the possible RAM""" start="00:01:19.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""in the computer. In this small example,""" start="00:01:21.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""we have one global variable""" start="00:01:21.448" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that is assigned a value,""" start="00:01:28.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but when assigning the value,""" start="00:01:31.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""we first allocate a temporary variable""" start="00:01:33.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and then a temporary list""" start="00:01:35.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and only retain some part of this list""" start="00:01:37.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""in this global variable.""" start="00:01:40.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""In terms of memory graph""" start="00:01:42.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""we can represent this as two variable slots,""" start="00:01:44.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""one transient, one permanent,""" start="00:01:50.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and then a list of three cons cells,""" start="00:01:53.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""part of which is retained as a global variable""" start="00:01:56.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but part of it which is a temporary variable symbol.""" start="00:02:01.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""The first term of the list is not used""" start="00:02:05.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and it might be cleared at some point.""" start="00:02:07.680" video="mainVideo-gc" id="subtitle"]]

[[!template new="1" text="""Garbage collection in Emacs""" start="00:02:09.760" video="mainVideo-gc" id="subtitle"]]

[[!template text="""So that's what Emacs does.""" start="00:02:09.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Every now and then, Emacs goes through all the memory""" start="00:02:12.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and identifies which part of the memory are not used""" start="00:02:15.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and then clear them so that it can free up the RAM.""" start="00:02:19.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""This process is called garbage collection""" start="00:02:23.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and Emacs uses a very simple and old algorithm""" start="00:02:25.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which is called Mark & Sweep.""" start="00:02:28.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So doing this mark and sweep process""" start="00:02:30.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""is basically two stages.""" start="00:02:33.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""First, Emacs scans all the memory that is allocated""" start="00:02:34.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and then identifies which memory is still in use""" start="00:02:40.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which is linked to some variables, for example,""" start="00:02:42.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and which memory is not used anymore""" start="00:02:45.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""even though it was allocated in the past.""" start="00:02:47.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""The second stage [??] whenever a memory is not,""" start="00:02:49.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that is not allocated. During the process""" start="00:02:53.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Emacs cannot do anything now.""" start="00:02:59.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So basically, every time Emacs scans the memory,""" start="00:03:00.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it freezes up and doesn't respond to anything,""" start="00:03:04.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and if it takes too much time so that users can notice it,""" start="00:03:07.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then of course Emacs is not responsive at all,""" start="00:03:10.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and if this garbage collection is triggered too frequently,""" start="00:03:13.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then it's not just not responsive every now and then.""" start="00:03:19.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""It's also not responsive all the time,""" start="00:03:22.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""almost all the time,""" start="00:03:24.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so it cannot even normally type or stuff""" start="00:03:26.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""or do some normal commands.""" start="00:03:27.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""This mark and sweep algorithm is taking longer""" start="00:03:32.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""the more memory Emacs uses. So basically,""" start="00:03:36.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""the more buffers you open, the more packages you load,""" start="00:03:40.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""the more complex commands you run, the more memory is used,""" start="00:03:44.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and basically, the longer Emacs takes""" start="00:03:48.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to perform a single garbage collection.""" start="00:03:52.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Of course, Emacs being Emacs""" start="00:03:57.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""this garbage collection can be tweaked.""" start="00:04:02.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""In particular users can tweak""" start="00:04:06.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""how frequently Emacs does garbage collection""" start="00:04:08.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""using two basic variables: `gc-cons-threshold`""" start="00:04:10.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and `gc-cons-percentage`.""" start="00:04:13.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""`gc-cons-threshold` is the raw number of kilobytes""" start="00:04:15.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Emacs needs to allocate""" start="00:04:21.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""before triggering another garbage collection,""" start="00:04:22.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and the `gc-cons-percentage` is similar,""" start="00:04:25.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but it's defined in terms of fraction""" start="00:04:27.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""of already-allocated memory.""" start="00:04:30.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""If you follow various Emacs forums,""" start="00:04:34.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you may be familiar with people complaining about""" start="00:04:38.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""garbage collection. There are many many suggestions""" start="00:04:41.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""about what to do with it.""" start="00:04:46.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Most frequently, you see `gc-cons-threshold`""" start="00:04:48.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""recommended to be increased,""" start="00:04:54.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and a number of pre-packaged Emacs distributions""" start="00:04:56.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like Doom Emacs do increase it.""" start="00:05:01.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""I have seen suggestions which are actually horrible""" start="00:05:04.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to disable garbage collection temporarily""" start="00:05:07.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""or for a long time.""" start="00:05:10.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Which is nice... You can see it quite frequently,""" start="00:05:14.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which indicates there might be some problem.""" start="00:05:17.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""However, every time one user poses about this problem,""" start="00:05:19.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's just one data point and it doesn't mean""" start="00:05:23.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that everyone actually suffers from it.""" start="00:05:26.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""It doesn't mean that everyone should do it.""" start="00:05:28.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So in order to understand if this garbage collection""" start="00:05:33.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""is really a problem which is a common problem""" start="00:05:35.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""we do need some kind of statistics""" start="00:05:39.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and only using the actual statistics""" start="00:05:44.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""we can understand if it should be recommended for everyone""" start="00:05:46.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to tweak the defaults or like whether""" start="00:05:52.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it should be recommended for certain users""" start="00:05:55.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""or maybe it should be asked Emacs devs""" start="00:05:57.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to do something about the defaults.""" start="00:05:59.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""And what I did some time ago is exactly this.""" start="00:06:01.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""I tried to collect the user statistics.""" start="00:06:07.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So I wrote a small package on Elp""" start="00:06:09.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and some users installed this package""" start="00:06:14.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and then reported back these statistics""" start="00:06:18.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""of the garbage collection for their particular use.""" start="00:06:22.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""By now we have obtained 129 user submissions""" start="00:06:24.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""with over 1 million GC records in there.""" start="00:06:30.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So like some of these submissions""" start="00:06:34.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""used default GC settings without any customizations.""" start="00:06:38.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Some used increased GC cost threshold""" start="00:06:43.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and GC cost percentage.""" start="00:06:46.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So using this data we can try to draw""" start="00:06:47.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""some reliable conclusions on what should be done""" start="00:06:53.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and whether should anything be done about garbage collection""" start="00:06:56.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""on Emacs dev level or at least on user level.""" start="00:06:59.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Of course we need to keep in mind""" start="00:07:02.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that there's some kind of bias""" start="00:07:05.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because it's more likely""" start="00:07:07.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that users already have problems with GC""" start="00:07:09.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""or they think they have problems with GC""" start="00:07:11.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""will report and submit the data.""" start="00:07:13.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""But anyway having s statistics is much more useful""" start="00:07:15.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""than just having anecdotal evidences""" start="00:07:20.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""from one or other reddit posts.""" start="00:07:22.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""And just one thing I will do""" start="00:07:25.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""during the rest of my presentation""" start="00:07:28.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""is that for all the statistics""" start="00:07:30.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""I will normalize user data""" start="00:07:32.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so that every user contributes equally.""" start="00:07:35.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""For example if one user submits like""" start="00:07:37.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""100 hours Emacs uptime statistics""" start="00:07:40.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and other users submit one hour Emacs uptime""" start="00:07:43.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then I will anyway make it so that they contribute equally.""" start="00:07:46.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Let's start from one of the most obvious things""" start="00:07:52.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""we can look into is""" start="00:07:56.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which is the time it takes for garbage collection""" start="00:07:57.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to single garbage collection process.""" start="00:08:00.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Here you see frequency distribution of GC duration""" start="00:08:05.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""for all the 129 users we got""" start="00:08:11.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and you can see that most of the garbage collections""" start="00:08:15.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""are done quite quickly in less than 0.1 second""" start="00:08:22.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and less than 0.1 second is usually just not noticeable.""" start="00:08:27.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So even though there is garbage collection""" start="00:08:32.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it will not interrupt the work in Emacs.""" start="00:08:34.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""However there is a fraction of users""" start="00:08:39.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""who experience garbage collection""" start="00:08:43.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it takes like 0.2, 0.3 or even half a second""" start="00:08:45.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which will be quite noticeable.""" start="00:08:48.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""For the purposes of this study""" start="00:08:50.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""I will consider that anything that is less than 0.1 second""" start="00:08:55.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which is insignificant so like you will not notice it""" start="00:08:59.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and it's like obviously""" start="00:09:02.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""all the Emacs usage will be just normal.""" start="00:09:04.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""But if it's more than 0.1 or 0.2 seconds""" start="00:09:07.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then it will be very noticeable""" start="00:09:11.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and you will see that Emacs hang for a little while""" start="00:09:13.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""or not so little while. In terms of numbers""" start="00:09:16.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's better to plot the statistics not as a distribution""" start="00:09:21.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but as a cumulative distribution.""" start="00:09:26.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So like at every point of this graph""" start="00:09:28.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you'll see like for example here 0.4 seconds""" start="00:09:31.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you have this percent of like almost 90% of users""" start="00:09:37.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""have no more than 0.4 gc duration.""" start="00:09:42.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So like we can look here if we take one""" start="00:09:49.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""gc critical gc duration which is 0.1 second""" start="00:09:53.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""0.1 second and look at how many users have""" start="00:09:56.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it so we have 56% which is like""" start="00:10:00.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""44% users have less than 0.1 second gc duration""" start="00:10:02.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and the rest 56% have more than 0.1 second.""" start="00:10:09.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So you can see like more than half of users""" start="00:10:12.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""actually have noticeable gc delay""" start="00:10:16.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so the Emacs freezes for some noticeable time""" start="00:10:20.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and a quarter of users actually have very noticeable""" start="00:10:23.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so like Emacs freezes such that you see an actual delay""" start="00:10:27.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that Emacs actually has""" start="00:10:31.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which is quite significant and important point.""" start="00:10:36.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""But apart from the duration of each individual gc""" start="00:10:44.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it is important to see how frequent it is""" start="00:10:47.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because even if you do notice a delay""" start="00:10:49.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""even a few seconds delay""" start="00:10:52.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it doesn't matter if it happens once""" start="00:10:54.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""during the whole Emacs session.""" start="00:10:57.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So if you look into frequency distribution again here""" start="00:10:59.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""I plot time between subsequent garbage collections""" start="00:11:05.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""versus how frequent it is and we have very clear trend""" start="00:11:13.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that most of the garbage collections are quite frequent""" start="00:11:17.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like we talk about every few seconds a few tens of seconds.""" start="00:11:21.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""There's a few outliers which are at very round numbers""" start="00:11:25.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like 60 seconds, 120 seconds, 300 seconds.""" start="00:11:30.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""These are usually timers so like""" start="00:11:35.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you have something running on timer""" start="00:11:37.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and then it is complex command""" start="00:11:40.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and it triggers garbage collection""" start="00:11:43.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but it's not the majority.""" start="00:11:45.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Again to run the numbers""" start="00:11:48.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's better to look into cumulative distribution""" start="00:11:51.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and see that 50% of garbage collections""" start="00:11:53.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""are basically less than 10 seconds apart.""" start="00:11:56.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""And we can combine it with previous data""" start="00:11:58.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and we look into whatever garbage collection""" start="00:12:02.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""takes less than 10 seconds from each other""" start="00:12:07.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and also takes more than say 0.1 seconds.""" start="00:12:09.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So and then we see that""" start="00:12:13.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""one quarter of all garbage collections""" start="00:12:15.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""are just noticeable and also frequent""" start="00:12:17.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and 9% are not like""" start="00:12:21.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""more than 0.2% very noticeable and also frequent.""" start="00:12:23.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So basically it constitutes Emacs freezing.""" start="00:12:27.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So 9% of all the garbage collection Emacs freezing.""" start="00:12:30.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Of course if you remember there is a bias""" start="00:12:33.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but 9% is quite significant number.""" start="00:12:37.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So garbage collection can really slow down things""" start="00:12:40.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""not for everyone but for significant fraction of users.""" start="00:12:44.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Another thing I'd like to look into""" start="00:12:48.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""is what I call agglomerated GCs.""" start="00:12:52.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""What I mean by agglomerated is""" start="00:12:55.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""when you have one garbage collection""" start="00:12:57.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and then another garbage immediately after it.""" start="00:13:00.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So in terms of numbers I took""" start="00:13:03.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""every subsequent garbage collection""" start="00:13:05.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which is either immediately after""" start="00:13:08.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""or no more than one second after each.""" start="00:13:10.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So from point of view of users is like""" start="00:13:13.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""multiple garbage collection they add up together""" start="00:13:16.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""into one giant garbage collection.""" start="00:13:20.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""And if you look into numbers""" start="00:13:23.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""of how many agglomerated garbage collections there are""" start="00:13:25.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you can see even numbers over 100.""" start="00:13:29.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So 100 garbage collection going one after another.""" start="00:13:32.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Even if you think about each garbage collection""" start="00:13:35.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""taking 0.1 second we look into 100 of them""" start="00:13:39.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's total 10 seconds.""" start="00:13:42.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""It's like Emacs hanging forever""" start="00:13:44.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""or like a significant number is also 10.""" start="00:13:46.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So again this would be very annoying to meet such thing.""" start="00:13:53.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""How frequently does it happen?""" start="00:13:56.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Again we can plot cumulative distribution""" start="00:13:57.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and we see that 20 percent like 19 percent""" start="00:14:00.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""of all the garbage collection are at least two together""" start="00:14:03.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and 8 percent like more than 10. So like you think about oh""" start="00:14:07.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""each garbage collection is not taking much time""" start="00:14:13.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but when you have 10 of them yeah that becomes a problem.""" start="00:14:15.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Another thing is to answer a question""" start="00:14:24.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that some people complain about is that""" start="00:14:29.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""longer you use Emacs the slower Emacs become.""" start="00:14:32.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Of course it may be caused by garbage collection""" start="00:14:35.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and I wanted to look into how garbage collection time""" start="00:14:43.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and other statistics,""" start="00:14:48.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""other parameters are evolving over time.""" start="00:14:49.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""And what I can see here is a cumulative distribution""" start="00:14:53.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""of GC duration for like first 10 minutes of Emacs uptime""" start="00:14:58.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""first 100 minutes first 1000 minutes.""" start="00:15:03.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""And if you look closer then you see""" start="00:15:06.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that each individual garbage collection on average""" start="00:15:10.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""takes longer as you use Emacs longer.""" start="00:15:14.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""However this longer is not much it's like maybe 10 percent""" start="00:15:18.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like basically garbage collection gets like""" start="00:15:24.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""slow Emacs down more as you use Emacs more but not much.""" start="00:15:29.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So basically if you do you see Emacs""" start="00:15:34.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""being slower and slower over time""" start="00:15:38.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's probably not really garbage collection""" start="00:15:40.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because it doesn't change too much.""" start="00:15:43.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""And if you look into time""" start="00:15:45.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""between individual garbage collections""" start="00:15:48.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and you see that the time actually increases""" start="00:15:50.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""as you use Emacs longer which makes sense""" start="00:15:53.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because initially like first few minutes""" start="00:15:56.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you have all kind of packages loading""" start="00:15:58.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like all the port loading and then later""" start="00:16:01.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""everything is loaded and things become more stable.""" start="00:16:04.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So the conclusion on this part is that""" start="00:16:07.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""if Emacs becomes slower in a long session""" start="00:16:12.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's probably not caused by garbage collection.""" start="00:16:16.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""And one word of warning of course is that""" start="00:16:18.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's all nice and all when I present the statistics""" start="00:16:23.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but it's only an average""" start="00:16:27.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and if you are an actual user like here is one example""" start="00:16:29.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which shows a total garbage collection time""" start="00:16:34.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like accumulated together over Emacs uptime""" start="00:16:37.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and you see different lines""" start="00:16:40.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which correspond to different sessions of one user""" start="00:16:43.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and you see they are wildly different""" start="00:16:45.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like one time there is almost no garbage collection""" start="00:16:48.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""another time you see garbage collection""" start="00:16:51.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because probably Emacs is used more early""" start="00:16:54.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""or like different pattern of usage""" start="00:16:57.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and even during a single Emacs session""" start="00:16:59.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you see a different slope""" start="00:17:03.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""of this curve which means that""" start="00:17:04.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""sometimes garbage collection is infrequent""" start="00:17:06.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and sometimes it's much more frequent""" start="00:17:09.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so it's probably much more noticeable one time""" start="00:17:11.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and less noticeable other time.""" start="00:17:14.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""So if you think about these statistics of course""" start="00:17:15.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""they only represent an average usage""" start="00:17:19.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but sometimes it can get worse sometimes it can get better.""" start="00:17:23.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""The last parameter I'd like to talk about is""" start="00:17:26.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""garbage collection during Emacs init.""" start="00:17:33.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Basically if you think about what happens during Emacs init""" start="00:17:35.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like when Emacs just starting up""" start="00:17:40.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then whatever garbage collection""" start="00:17:41.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""there it's one or it's several times""" start="00:17:44.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it all contributes to Emacs taking longer to start.""" start="00:17:46.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""And again we can look into the statistic""" start="00:17:51.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and see what is the total GC duration after Emacs init""" start="00:17:56.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and we see that 50% of all the submissions""" start="00:18:01.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""garbage collection adds up more than one second""" start="00:18:06.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to Emacs init time and for 20% of users""" start="00:18:10.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's extra three seconds Emacs start time""" start="00:18:14.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which is very significant""" start="00:18:17.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""especially for people who are used to Vim""" start="00:18:18.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which can start in like a fraction of a second""" start="00:18:21.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and here it just does garbage collection""" start="00:18:23.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because garbage collection is not""" start="00:18:26.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""everything Emacs does during startup""" start="00:18:27.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""adds up more to the load.""" start="00:18:29.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Okay that's all nice and all""" start="00:18:32.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but what can we do about these statistics""" start="00:18:36.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""can we draw any conclusions""" start="00:18:38.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and the answer is of course""" start="00:18:40.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like the most important conclusion here is that""" start="00:18:43.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""yes garbage collection can slow down Emacs""" start="00:18:46.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""at least for some people and what to do about it""" start="00:18:49.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""there are two variables which you can tweak""" start="00:18:52.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's because gcconce threshold gcconce percentage""" start="00:18:55.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and having the statistics I can at least look a little bit""" start="00:18:58.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""into what is the effect of increasing these variables""" start="00:19:03.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like most people just increase gcconce threshold""" start="00:19:08.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and like all the submissions people did increase""" start="00:19:12.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and doesn't make much sense to decrease it""" start="00:19:16.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like to make things worse""" start="00:19:19.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""of course for these statistics""" start="00:19:21.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""the exact values of this increased thresholds""" start="00:19:27.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""are not always the same""" start="00:19:31.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but at least we can look into some trends""" start="00:19:33.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so first and obvious thing we can observe""" start="00:19:36.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""is when we compare""" start="00:19:44.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""the standard gc settings standard thresholds""" start="00:19:46.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and increased thresholds for time between""" start="00:19:50.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""subsequent gcs and as one may expect""" start="00:19:54.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""if you increase the threshold""" start="00:19:57.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Emacs will do garbage collection less frequently""" start="00:19:59.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so the spacing between garbage collection increases""" start="00:20:02.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""okay the only thing is that""" start="00:20:05.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""if garbage collection is less frequent""" start="00:20:07.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then each individual garbage collection becomes longer""" start="00:20:10.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so if you think about increasing""" start="00:20:14.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""garbage collection thresholds be prepared""" start="00:20:18.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that in each individual time Emacs freezes will take longer""" start="00:20:22.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""this is one caveat when we talk about""" start="00:20:26.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""this agglomerated gcs which are one after other""" start="00:20:31.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like if you increase the threshold sufficiently""" start="00:20:34.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then whatever happened that garbage collections""" start="00:20:36.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""were like done one after other""" start="00:20:42.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""we can now make it so that they are actually separated""" start="00:20:44.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so like you don't see one giant freeze caused by""" start="00:20:47.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like 10 gcs in a row""" start="00:20:51.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""instead you can make it so that they are separated""" start="00:20:52.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and in statistics it's very clear""" start="00:20:55.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that the number of agglomerated garbage collections""" start="00:20:59.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""decreases dramatically when you increase the thresholds""" start="00:21:02.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's particularly evident when we look into startup time""" start="00:21:06.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""if you look at gc duration during Emacs startup""" start="00:21:11.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and if we look into what happens""" start="00:21:17.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""when you increase the thresholds""" start="00:21:19.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's very clear that Emacs startup become faster""" start="00:21:20.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""when you increase gc thresholds""" start="00:21:23.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so that's all for actual user statistics""" start="00:21:26.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and now let's try to run into""" start="00:21:33.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""some like actual recommendations""" start="00:21:35.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""on what numbers to set and before we start""" start="00:21:38.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""let me explain a little bit about""" start="00:21:42.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""the difference between these two variables""" start="00:21:44.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which is gc constant threshold and gc constant percentage""" start="00:21:46.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so if you think about Emacs memory""" start="00:21:48.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like there's a certain memory allocated by Emacs""" start="00:21:52.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and then as you run commands and turn using Emacs""" start="00:21:55.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""there is more memory allocated""" start="00:21:58.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and Emacs decides when to do garbage collection""" start="00:22:00.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""according these two variables""" start="00:22:04.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and actually what it does it chooses the larger one""" start="00:22:06.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so say you have you are late in Emacs session""" start="00:22:08.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you have a lot of Emacs memory allocated""" start="00:22:12.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then you have gc constant percentage""" start="00:22:14.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which is percent of the already allocated memory""" start="00:22:17.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and that percent is probably going to be the largest""" start="00:22:19.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because you have more memory""" start="00:22:25.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and memory means that percent of it is larger""" start="00:22:28.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so like you have a larger number cost""" start="00:22:32.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""by gc constant percentage""" start="00:22:36.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so in this scenario when Emacs session is already running""" start="00:22:37.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""for a long time and there is a lot of memory allocated""" start="00:22:43.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you have gc constant percentage""" start="00:22:45.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""controlling the garbage collection""" start="00:22:50.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""while early in Emacs there is not much memory placed""" start="00:22:52.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""Emacs just starting up then gc constant threshold""" start="00:22:55.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""is controlling how frequently garbage collection happens""" start="00:22:58.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because smaller allocated memory""" start="00:23:01.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""means its percentage will be a small number""" start="00:23:04.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so in terms of default values at least""" start="00:23:06.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""gc constant threshold is 800 kilobytes""" start="00:23:12.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and gc constant percentage is 10""" start="00:23:14.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so gc constant percentage becomes larger than that threshold""" start="00:23:18.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""when you have more than eight megabytes of allocated memory""" start="00:23:24.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""by Emacs which is quite early""" start="00:23:28.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and it will probably hold just during the startup""" start="00:23:31.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and once you start using your maximum""" start="00:23:34.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and once you load all the histories""" start="00:23:36.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""all the kinds of buffers it's probably going to take""" start="00:23:38.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""more than much more than eight megabytes""" start="00:23:42.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so now we understand this""" start="00:23:43.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""we can draw certain recommendations""" start="00:23:50.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""about tweaking the gc thresholds""" start="00:23:53.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so first of all I need to emphasize""" start="00:23:57.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that any time you increase gc threshold""" start="00:24:01.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""an individual garbage collection time increases""" start="00:24:03.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so it's not free at all""" start="00:24:07.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""if you don't have problems with garbage collection""" start="00:24:08.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which is half of the users don't have much problem""" start="00:24:11.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you don't need to tweak anything""" start="00:24:13.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""only when gc is frequent and slow""" start="00:24:15.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""when Emacs is really really present frequently""" start="00:24:19.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you may consider increasing gc thresholds only""" start="00:24:23.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and in particular I recommend""" start="00:24:27.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""increasing gc constant percentage""" start="00:24:31.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because that's what mostly controls gc""" start="00:24:33.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""when Emacs is running for long session""" start="00:24:36.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and the numbers are probably like""" start="00:24:40.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""yeah we can estimate the effect of these numbers""" start="00:24:43.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like for example if you have a default value of 0.1 percent""" start="00:24:46.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""for gc constant percentage 0.1 which is 10 percent""" start="00:24:49.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and then increase it twice""" start="00:24:52.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""obviously you get twice less frequent gcs""" start="00:24:55.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but it will come at the cost of extra 10 percent gc time""" start="00:24:58.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and if you increase 10 times you can think about""" start="00:25:02.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""10 less 10 x less frequent gcs""" start="00:25:05.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but almost twice longer individual garbage collection time""" start="00:25:08.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so probably you want to set the number closer to 0.1""" start="00:25:12.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""another part of the users may actually""" start="00:25:16.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""try to optimize Emacs startup time""" start="00:25:23.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which is quite frequent problem""" start="00:25:28.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""in this case it's probably better to increase gc constant""" start="00:25:30.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but not too much so like""" start="00:25:34.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""first of all it makes sense to check""" start="00:25:38.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""whether garbage collection is a problem at all""" start="00:25:40.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""during startup and there are two variables""" start="00:25:43.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which can show what is happening this garbage collection""" start="00:25:46.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so gc done is a variable that shows""" start="00:25:50.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""how many garbage collection""" start="00:25:53.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like what is the number of garbage collections triggered""" start="00:25:55.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like when you check the value""" start="00:26:00.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""or right after you start Emacs""" start="00:26:02.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you will see that""" start="00:26:04.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""number and gc elapsed variable""" start="00:26:04.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which gives you a number of seconds""" start="00:26:08.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which Emacs spent in doing garbage collection""" start="00:26:11.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so this is probably the most important variable""" start="00:26:14.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and if you see it's large then you may consider tweaking it""" start="00:26:16.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""for the Emacs startup we can estimate some bounds""" start="00:26:20.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because in the statistics I never saw anything""" start="00:26:26.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that is more than 10 seconds extra""" start="00:26:30.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""which even 10 seconds is probably like""" start="00:26:32.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""a really really hard upper bound so""" start="00:26:34.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""or say if you want to decrease the gc contribution""" start="00:26:39.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like order of magnitude or like two orders of magnitudes""" start="00:26:44.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""let's say like as a really hard top estimate""" start="00:26:47.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then it corresponds to 80 megabytes gc constant""" start="00:26:50.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and probably much less so like""" start="00:26:55.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""there's no point setting it""" start="00:26:58.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to a few hundred megabytes of course""" start="00:27:00.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""there's one caveat which is important to keep in""" start="00:27:04.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""mind though that increasing the gc thresholds""" start="00:27:08.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""is not just increasing individual gc time""" start="00:27:14.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""there's also an actual real impact on the RAM usage""" start="00:27:16.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so like if you increase gc threshold""" start="00:27:20.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it increases the RAM usage of Emacs""" start="00:27:23.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and you shouldn't think that like okay""" start="00:27:26.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""I increased the threshold by like 100 megabytes""" start="00:27:29.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then 100 megabytes extra RAM usage doesn't matter""" start="00:27:33.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's not 100 megabytes""" start="00:27:37.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because less frequent garbage collection means""" start="00:27:38.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it will lead to memory fragmentation""" start="00:27:42.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so in practice if you increase the thresholds""" start="00:27:45.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to tens or hundreds of megabytes""" start="00:27:50.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""we are talking about gigabytes extra RAM usage""" start="00:27:52.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""for me personally when I tried to play with gc thresholds""" start="00:27:55.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""I have seen Emacs taking two gigabytes like""" start="00:27:59.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""compared to several times less""" start="00:28:02.880" video="mainVideo-gc" id="subtitle"]]
[[!template text="""when with default settings so it's not free at all""" start="00:28:05.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and only like either when you have a lot of free RAM""" start="00:28:09.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and you don't care or when your Emacs is really slow""" start="00:28:13.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then you may need to consider this""" start="00:28:16.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""tweaking these defaults so again don't tweak defaults""" start="00:28:19.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""if you don't really have a problem""" start="00:28:23.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and of course this RAM problem is a big big deal""" start="00:28:24.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""for Emacs devs because from from the point of single user""" start="00:28:29.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you have like normal laptop most likely like normal PC""" start="00:28:35.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""with a lot of RAM you don't care about these things too much""" start="00:28:38.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but Emacs in general can run on like all kinds of machines""" start="00:28:42.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""including low-end machines with very limited RAM""" start="00:28:49.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and anytime Emacs developers consider increasing""" start="00:28:51.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""the defaults for garbage collection""" start="00:28:55.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's like they always have to consider""" start="00:28:57.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""if you increase them too much""" start="00:29:01.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then Emacs may just stop running on certain platforms""" start="00:29:02.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so that's a very big consideration in terms""" start="00:29:07.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""of the global defaults for everyone""" start="00:29:14.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""although I have to I would say that it might be related""" start="00:29:16.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to the safe to increase GCCons threshold""" start="00:29:22.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because it mostly affects startup and during startup""" start="00:29:24.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's probably not the peak usage of Emacs""" start="00:29:27.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and like as Emacs runs for longer""" start="00:29:31.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it's probably where most of RAM will be used later""" start="00:29:35.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""on the other hand GCCons percentage is much more debating""" start="00:29:38.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because it has pros and cons""" start="00:29:44.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it will increase the RAM usage""" start="00:29:46.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it will increase the individual GC time so""" start="00:29:47.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""if we consider changing it it's much more tricky""" start="00:29:51.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and we have discussing probably measure the impact on users""" start="00:29:56.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and a final note on or from the point of view""" start="00:29:59.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""of Emacs development is""" start="00:30:05.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that this simple mark-and-sweep algorithm""" start="00:30:07.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""is like a very old and not the state-of-the-art algorithm""" start="00:30:11.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""there are variants of garbage collection""" start="00:30:14.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that are like totally non-blocking""" start="00:30:17.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so Emacs just doesn't have to freeze""" start="00:30:19.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""during the garbage collection""" start="00:30:22.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""or there are variants of garbage collection algorithm""" start="00:30:24.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that do not scan all the memory just fraction of it""" start="00:30:26.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and scan another fraction less frequently""" start="00:30:30.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so there are actually ways just to change""" start="00:30:33.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""the garbage collection algorithm to make things much faster""" start="00:30:37.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""of course like just changing the numbers of variables""" start="00:30:39.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like the numbers of variable values""" start="00:30:44.200" video="mainVideo-gc" id="subtitle"]]
[[!template text="""is much more tricky and one has to implement it""" start="00:30:47.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""obviously it would be nice if someone implements it""" start="00:30:50.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but so far it's not happening so yeah it would be nice""" start="00:30:52.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but maybe not not so quickly""" start="00:30:55.640" video="mainVideo-gc" id="subtitle"]]
[[!template text="""there is more chance to change the defaults here""" start="00:30:59.360" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to conclude let me reiterate the most important points""" start="00:31:02.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so from point of view of users you need to understand that""" start="00:31:07.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""yes garbage collection may be a problem""" start="00:31:11.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but not for everyone so like""" start="00:31:14.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you should only think about changing the variables""" start="00:31:16.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""when you really know that garbage collection""" start="00:31:21.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""is the problem for you so if you have slow Emacs startup""" start="00:31:23.560" video="mainVideo-gc" id="subtitle"]]
[[!template text="""slow Emacs startup and you know that it's caused by""" start="00:31:27.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""garbage collection like by""" start="00:31:30.920" video="mainVideo-gc" id="subtitle"]]
[[!template text="""you can check the GC elapsed variable""" start="00:31:32.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then you may increase GC count threshold""" start="00:31:36.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""like to few tens of megabytes not more""" start="00:31:39.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""it doesn't make sense to increase it much more""" start="00:31:42.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and if you really have major problems""" start="00:31:44.480" video="mainVideo-gc" id="subtitle"]]
[[!template text="""with Emacs being slaggy""" start="00:31:48.240" video="mainVideo-gc" id="subtitle"]]
[[!template text="""then you can increase GC count percentage""" start="00:31:49.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to like 0.2 0.3 maybe""" start="00:31:52.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""one is probably overkill""" start="00:31:56.000" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but do watch your Emacs ROM usage it may be really impacted""" start="00:31:57.680" video="mainVideo-gc" id="subtitle"]]
[[!template text="""for Emacs developers I'd like to emphasize""" start="00:32:02.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""that there is a real problem with garbage collection""" start="00:32:09.720" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and nine percent of all the garbage collection""" start="00:32:12.440" video="mainVideo-gc" id="subtitle"]]
[[!template text="""data points we have correspond""" start="00:32:17.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""to really slow noticeable Emacs precision""" start="00:32:22.080" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and really frequent less than 10 seconds""" start="00:32:24.960" video="mainVideo-gc" id="subtitle"]]
[[!template text="""I'd say that it's really worth""" start="00:32:28.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""increasing GC count threshold at least during startup""" start="00:32:32.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""because it really impacts the Emacs startup time""" start="00:32:35.280" video="mainVideo-gc" id="subtitle"]]
[[!template text="""making Emacs startup much faster""" start="00:32:40.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""ideally we need to reimplement""" start="00:32:41.520" video="mainVideo-gc" id="subtitle"]]
[[!template text="""the garbage collection algorithm of course it's not easy""" start="00:32:44.800" video="mainVideo-gc" id="subtitle"]]
[[!template text="""but it would be really nice""" start="00:32:48.600" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and for GC count percentage defaults it's hard to say""" start="00:32:50.160" video="mainVideo-gc" id="subtitle"]]
[[!template text="""we may consider changing it but it's up to discussion""" start="00:32:56.400" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and we probably need to be conservative here""" start="00:33:00.760" video="mainVideo-gc" id="subtitle"]]
[[!template text="""so we came to the end of my talk""" start="00:33:03.120" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and this presentation""" start="00:33:06.040" video="mainVideo-gc" id="subtitle"]]
[[!template text="""all the data will be available publicly""" start="00:33:09.320" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and you can reproduce all the statistic graphs if you wish""" start="00:33:11.840" video="mainVideo-gc" id="subtitle"]]
[[!template text="""and thank you for attention""" start="00:33:17.080" video="mainVideo-gc" id="subtitle"]]

Questions or comments? Please e-mail [yantar92@posteo.net](mailto:yantar92@posteo.net?subject=Comment%20for%20EmacsConf%202023%20gc%3A%20emacs-gc-stats%3A%20Does%20garbage%20collection%20actually%20slow%20down%20Emacs%3F)


<!-- End of emacsconf-publish-after-page -->