-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatData.json
More file actions
932 lines (932 loc) · 31.7 KB
/
Copy pathchatData.json
File metadata and controls
932 lines (932 loc) · 31.7 KB
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
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
{
"demoTitle": "Spotting Digital Waste in Code gives you energy",
"model": "ChatGPT 5.4",
"thinkingDelay": 2200,
"messageDelay": 500,
"steps": [
{
"role": "user",
"stepNumber": 0,
"content": "Before we start, introduce yourself and then interview me"
},
{
"role": "assistant",
"stepNumber": "0A",
"slide": "Meet Sparky",
"presentationStyle": "popup",
"content": "I am Sparky, your AI co-host. Curious, concise, and professional. I will ask Wilco three quick questions so everyone knows who is speaking and why this topic matters today.",
"media": [
{
"type": "image",
"src": "robot-assistant.svg",
"className": "robot-float",
"caption": "Sparky, your AI co-host."
}
]
},
{
"role": "user",
"stepNumber": "0B",
"content": "Go ahead"
},
{
"role": "assistant",
"stepNumber": "0C",
"slide": "Speaker Intro",
"content": "First question for Wilco: who are you, and what do you spend your time working on?"
},
{
"role": "user",
"stepNumber": "0D",
"content": "Next question"
},
{
"role": "assistant",
"stepNumber": "0E",
"slide": "Speaker Intro",
"content": "Second question for Wilco: what do you actually do, and why do software, architecture, and sustainability belong in the same conversation for you?"
},
{
"role": "user",
"stepNumber": "0F",
"content": "One more"
},
{
"role": "assistant",
"stepNumber": "0G",
"slide": "My Upbringing",
"presentationStyle": "popup",
"content": "Final question for Wilco: where does that perspective come from? Part of the answer is upbringing. Growing up around heavy industry made energy use, material flows, and waste feel visible and real from the start.",
"openImageFullscreenAfterSpeech": true,
"media": [
{
"type": "image",
"src": "upbrining.png",
"caption": "A glimpse of the environment that shaped how I think about energy, industry, and waste."
}
]
},
{
"role": "user",
"stepNumber": 1,
"content": "What is this session about?"
},
{
"role": "popup",
"stepNumber": 2,
"content": "Spotting digital waste in code gives you energy because once you see waste clearly, you can do something about it."
},
{
"role": "user",
"stepNumber": 3,
"content": "What will I learn here?"
},
{
"role": "assistant",
"stepNumber": 4,
"slide": "Agenda",
"content": "You move through four stages: awareness, dialogue, decision frames, and action. The goal is to make waste visible and discussable."
},
{
"role": "user",
"stepNumber": 5,
"content": "Where does this start?"
},
{
"role": "assistant",
"stepNumber": 6,
"slide": "Opening Video",
"content": "It starts with a visual cue. Before code, you are invited to notice the act of looking closely.",
"media": [
{
"type": "video",
"src": ".pptx_extract/ppt/media/media1.mp4",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "6A",
"content": "Who is Freek"
},
{
"role": "assistant",
"stepNumber": 7,
"slide": "Spotting in Nature",
"content": "**This is Freek.**\n\nFreek loves wildlife spotting.\n\nWhen Freek spots a rare bird, he does not just go outside. He records it at https://waarneming.nl/.\n\nThat helps researchers and policymakers understand what is living out there.\n\nWhat you notice today can make a difference for nature conservation tomorrow.\n\n**Be like Freek.**",
"mediaLayout": "right",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image24.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "7A",
"content": "What does spotting teach you?"
},
{
"role": "assistant",
"stepNumber": 8,
"slide": "Spotting in Nature",
"content": "Spotting trains your eyes. You go out early, keep looking, and slowly learn to recognize what deserves attention.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image26.jpeg",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": 9,
"content": "What do you notice first?"
},
{
"role": "popup",
"stepNumber": 10,
"content": "A plastic bottle. A paper bag. Waste that was there all along, but now stands out immediately.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image28.jpeg",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": 11,
"content": "Why didn't I see it before?"
},
{
"role": "popup",
"stepNumber": 12,
"content": "Habit makes waste disappear into the background.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image29.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": 13,
"content": "What else makes it easy to miss?"
},
{
"role": "popup",
"stepNumber": 14,
"content": "Another reason is ownership. If it feels like someone else's problem, it becomes easy to ignore.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image30.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": 15,
"content": "When can you not ignore it anymore?"
},
{
"role": "popup",
"stepNumber": 16,
"content": "It reaches the point where ignoring it is no longer possible.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image31.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": 17,
"content": "When does it become a value question?"
},
{
"role": "popup",
"stepNumber": 18,
"content": "The shift happens when value becomes visible. Waste looks very different once you ask what something is worth.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image32.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "18A",
"content": "What changes once you frame it as value?"
},
{
"role": "assistant",
"stepNumber": 19,
"slide": "Tree Value",
"content": "The tree is framed as real value, roughly 150,000 to 250,000 euros. That reframes careless loss as measurable damage.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image32.png",
"caption": "Tree value made tangible."
}
]
},
{
"role": "user",
"stepNumber": 20,
"content": "How does that relate to software?"
},
{
"role": "assistant",
"stepNumber": 21,
"slide": "Electricity Maps",
"content": "You bring in Electricity Maps to make infrastructure consumption feel physical. Compute is not abstract; it runs somewhere real, with location, intensity, and trade-offs.",
"openImageFullscreenAfterSpeech": true,
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image33.png",
"caption": "Electricity Maps view with the live generation mix."
}
]
},
{
"role": "user",
"stepNumber": "21A",
"content": "So what's the core idea?"
},
{
"role": "assistant",
"stepNumber": 22,
"slide": "Cost Without Value",
"content": "Here the core definition lands: digital waste is cost without value. That cost can be money, energy, capacity, or attention.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image39.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "22A",
"content": "Can you show that in the cloud?"
},
{
"role": "assistant",
"stepNumber": "22B",
"slide": "AWS Example",
"content": "This becomes concrete with AWS. Waste is not abstract here either. It shows up in the infrastructure choices teams make every day.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image40.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "22C",
"content": "Where do you see that choice?"
},
{
"role": "assistant",
"stepNumber": "22D",
"slide": "Instance Types",
"content": "It starts with instance selection. The platform gives you many shapes, but that flexibility also makes overprovisioning easy.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image41.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "22E",
"content": "Any caveat before we compare?"
},
{
"role": "assistant",
"stepNumber": "22F",
"slide": "Comparison Caveat",
"content": "In this story, the terms virtual machines, containers, and pods are treated as interchangeable. The point is the waste pattern, not the infrastructure taxonomy."
},
{
"role": "user",
"stepNumber": "22G",
"content": "What happens at low utilization?"
},
{
"role": "assistant",
"stepNumber": "22H",
"slide": "25% Utilization",
"content": "At 25% utilization, a shared 16-vCPU AWS instance uses about 340 kWh per year, while a dedicated on-prem 16-core server uses about 1,600 kWh per year."
},
{
"role": "user",
"stepNumber": "22H1",
"content": "Why is there such a difference between AWS and on-prem?"
},
{
"role": "assistant",
"stepNumber": "22H2",
"slide": "Why AWS Differs",
"content": "Because the comparison is not one dedicated machine versus another dedicated machine. In AWS, that workload runs on shared infrastructure, so the energy burden of the physical server is spread across many tenants. On-prem, a lightly used dedicated server still carries most of its baseline power cost by itself."
},
{
"role": "user",
"stepNumber": "22I",
"content": "What about higher utilization?"
},
{
"role": "assistant",
"stepNumber": "22J",
"slide": "75% Utilization",
"content": "At 75% utilization, a shared 16-vCPU AWS instance uses about 640 kWh per year, while a dedicated on-prem 16-core server is around 2,700 kWh per year."
},
{
"role": "user",
"stepNumber": "22K",
"content": "How do you quantify that?"
},
{
"role": "assistant",
"stepNumber": 23,
"slide": "Consolidation Example",
"content": "Then you quantify it. Consolidating three 25% VMs into one 75% VM can save roughly two full instance costs, or about 13,000 euros per year with m5.4xlarge on-demand pricing."
},
{
"role": "user",
"stepNumber": 24,
"content": "What should I look for in a real system?"
},
{
"role": "assistant",
"stepNumber": 25,
"slide": "Three Signals",
"content": "Look for three signals: too much capacity with too little use, slowness without full CPU, or one saturated part while the rest waits."
},
{
"role": "user",
"stepNumber": 26,
"content": "What forms does digital waste usually take?"
},
{
"role": "assistant",
"stepNumber": 27,
"slide": "Four Types",
"content": "You meet it as idle resources, structural overcapacity, repeated default settings, or hidden compute that adds no visible value."
},
{
"role": "user",
"stepNumber": 28,
"content": "Why does this stay around for years?"
},
{
"role": "assistant",
"stepNumber": 29,
"slide": "Link with Tech Debt",
"content": "Because technical debt makes change expensive. Tight coupling, maintenance burden, and fear of breakage keep waste in place."
},
{
"role": "user",
"stepNumber": 30,
"content": "How do I think beyond electricity savings?"
},
{
"role": "assistant",
"stepNumber": 31,
"slide": "Workload Quality",
"content": "The question changes. Not only 'how do we save power?' but 'is this workload healthy, efficient, and worth running at all?'"
},
{
"role": "user",
"stepNumber": "31A",
"content": "Can you show that visually?"
},
{
"role": "assistant",
"stepNumber": 32,
"slide": "Workload Quality Visual",
"content": "This visual makes the pivot concrete by separating power use from utilization. A system can consume plenty without delivering much.",
"openImageFullscreenAfterSpeech": true,
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image42.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "32A",
"content": "What does that reinforce?"
},
{
"role": "assistant",
"stepNumber": 33,
"slide": "Workload Quality Sequence",
"content": "It reinforces the same point: healthy workloads balance value, efficiency, and operational quality, not just raw activity."
},
{
"role": "user",
"stepNumber": "33A",
"content": "Can you request core utilization for a virtual machine in Linux?"
},
{
"role": "assistant",
"stepNumber": "33B",
"slide": "Linux proc stat",
"content": "Yes. In Linux, `/proc/stat` exposes cumulative CPU time counters for the whole system and for each core. The image shows those `cpu`, `cpu0`, `cpu1`, and similar lines. Each line reports time spent in modes like user, system, idle, and iowait. By reading the counters twice and comparing the change over time, you can estimate utilization per core, even inside a virtual machine.",
"openImageFullscreenAfterSpeech": true,
"media": [
{
"type": "image",
"src": "procstat.png",
"caption": "Example of `/proc/stat` CPU counters in Linux."
}
]
},
{
"role": "user",
"stepNumber": 34,
"content": "Can a tiny code change really matter that much?"
},
{
"role": "popup",
"stepNumber": 35,
"content": "Only 40 lines of code can hide a massive gap in latency, work done, and energy consumed.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image50.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "35A",
"content": "What example do you use?"
},
{
"role": "assistant",
"stepNumber": "35B",
"slide": "OpenJDK Issue",
"presentationStyle": "popup",
"content": "It starts with a concrete OpenJDK issue. That makes the case specific immediately, not abstract.",
"openImageFullscreenAfterSpeech": true,
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image47.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "35C",
"content": "Why does that catch attention?"
},
{
"role": "assistant",
"stepNumber": 36,
"slide": "Primeagen",
"presentationStyle": "popup",
"content": "Because it makes the idea feel real. You can immediately see that even a tiny code change can have a surprisingly large effect on performance, work done, and energy use.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image48.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "36A",
"content": "What stands out in that story?"
},
{
"role": "assistant",
"stepNumber": "36B",
"slide": "Commit Log",
"presentationStyle": "popup",
"content": "A tiny commit in a long stream of work suddenly matters. That is exactly the point: small code can hide very large waste.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image49.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "36C",
"content": "How do you introduce the concrete case?"
},
{
"role": "assistant",
"stepNumber": 37,
"slide": "Code Case Intro",
"presentationStyle": "popup",
"content": "A bug report and a tiny implementation detail become the entry point. That makes the waste feel concrete, not theoretical.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image51.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "37A",
"content": "What's the core technical idea?"
},
{
"role": "assistant",
"stepNumber": 38,
"slide": "Procfs vs Direct Clock",
"content": "The core idea is simple: reading procfs means opening text and parsing it, while direct clock access is simpler and faster."
},
{
"role": "user",
"stepNumber": 39,
"content": "What does the old implementation look like?"
},
{
"role": "assistant",
"stepNumber": 40,
"slide": "Old Implementation",
"presentationStyle": "popup",
"content": "Here is the old procfs-based path. The important thing is not the line count, but the amount of work hidden behind it.",
"code": [
{
"language": "cpp",
"caption": "Opening the procfs stat file and reading its contents.",
"content": "static jlong user_thread_cpu_time(Thread* thread) {\n pid_t tid = thread->osthread()->thread_id();\n char* s;\n char stat[2048];\n size_t statlen;\n char proc_name[64];\n int count;\n long sys_time, user_time;\n char cdummy;\n int idummy;\n long ldummy;\n FILE* fp;\n\n os::snprintf_checked(proc_name, 64, \"/proc/self/task/%d/stat\", tid);\n fp = os::fopen(proc_name, \"r\");\n if (fp == nullptr) return -1;\n\n statlen = fread(stat, 1, 2047, fp);\n stat[statlen] = '\\0';\n fclose(fp);"
},
{
"language": "cpp",
"caption": "Skipping the command string, parsing fields, and returning user time.",
"content": " s = strrchr(stat, ')');\n if (s == nullptr) return -1;\n do { s++; } while (s && isspace((unsigned char)*s));\n\n count = sscanf(s, \"%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu\",\n &cdummy, &idummy, &idummy, &idummy, &idummy, &idummy,\n &ldummy, &ldummy, &ldummy, &ldummy, &ldummy,\n &user_time, &sys_time);\n\n if (count != 13) return -1;\n return (jlong)user_time * (1000000000 / os::Posix::clock_tics_per_second());\n}"
}
]
},
{
"role": "user",
"stepNumber": "40A",
"content": "Where do the first hotspots show up?"
},
{
"role": "assistant",
"stepNumber": "40B",
"slide": "fopen Hotspot",
"presentationStyle": "popup",
"content": "The first hotspot is opening the file. Even before parsing, path resolution and setup already cost real work.",
"mediaColumns": 2,
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image54.png",
"caption": ""
},
{
"type": "image",
"src": ".pptx_extract/ppt/media/image55.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "40C",
"content": "What about the read path?"
},
{
"role": "assistant",
"stepNumber": "40D",
"slide": "fread and fclose",
"presentationStyle": "popup",
"content": "Then the read and close path show up. That is where kernel work, copying, and teardown add more cost than the tiny code suggests.",
"mediaColumns": 2,
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image56.png",
"caption": ""
},
{
"type": "image",
"src": ".pptx_extract/ppt/media/image57.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "40E",
"content": "Where does parsing show up?"
},
{
"role": "assistant",
"stepNumber": 41,
"slide": "sscanf Hotspot",
"presentationStyle": "popup",
"content": "Parsing is another hotspot. The ASCII conversion work is branch-heavy and surprisingly expensive for such a small-looking path.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image58.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "41A",
"content": "Can you model that at a higher level?"
},
{
"role": "assistant",
"stepNumber": "41B",
"slide": "Theoretical Model",
"presentationStyle": "popup",
"content": "Yes. A simple model links frequency, micro-operations, voltage, and switching. It is not perfect physics. It is a way to reason about where dynamic work is happening.",
"openImageFullscreenAfterSpeech": true,
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image59.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "41C",
"content": "Can you show that on real code?"
},
{
"role": "assistant",
"stepNumber": "41D",
"slide": "Generated Example",
"presentationStyle": "popup",
"content": "Yes. Here the code is shown with inline annotations for estimated micro-operations and energy cost. The point is to make hidden runtime work visible directly next to the code itself.",
"media": [
{
"type": "image",
"src": "Screenshot Example.png",
"caption": ""
}
],
"code": [
{
"language": "csharp",
"caption": "Annotated example with inline estimates taken from the screenshot.",
"content": "using System.Linq; // no runtime energy\n\nclass Program\n{\n static void Main()\n {\n const int N = 1_000_000; // compile-time constant - no runtime energy\n var rnd = new Random(); // 5 uOp -> 2 e-9 mWh = 0.000002 mWh\n var list = new List<int>(capacity: N); // 10 uOp -> 4 e-9 mWh = 0.000004 mWh\n\n // Loop body: 21 uOp per iteration -> 21 uOp x 1 000 000 = **21 000 000 uOp**\n for (int i = 0; i < N; i++) // loop overhead 3 uOp/iter -> 0.0012 mWh\n {\n int a = rnd.Next(1000), b = rnd.Next(1000);\n // 10 uOp/iter (two RNG calls) -> 0.004 mWh\n\n int sum = a + b, prod = a * b; // 3 uOp/iter -> 0.0012 mWh\n bool even = (sum % 2 == 0); // 3 uOp/iter -> 0.0012 mWh\n\n list.Add(even ? prod : sum); // 2 uOp/iter -> 0.0008 mWh\n // **Loop total = 0.0084 mWh**\n }\n\n list.Sort(); // ~200 M uOp (Timsort) -> 0.080 mWh\n var groups = list.GroupBy(x => x); // ~1.08 M uOp (hash buckets + scan) -> 0.000432 mWh\n var maxFreq = groups.Max(g => g.Count()); // ~1 M uOp (final scan) -> 0.000400 mWh\n\n Console.WriteLine($\"Max frequency: {maxFreq}\");\n // 30 uOp -> 1.2 e-8 mWh (negligible)\n }\n}"
}
]
},
{
"role": "user",
"stepNumber": "41E",
"content": "Could GenAI predict the bottlenecks from that code?"
},
{
"role": "assistant",
"stepNumber": "41F",
"slide": "GenAI Question",
"presentationStyle": "popup",
"content": "That leads to the real question: given this annotated code and the theoretical model, could GenAI point to the likely hotspots before profiling confirms them?",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image61.jpeg",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": "41G",
"content": "What hotspots would it probably point to first?"
},
{
"role": "assistant",
"stepNumber": "41H",
"slide": "Likely Hotspots",
"content": "A plausible answer would be: `fopen()`, `fread()`, and `sscanf()`. Each one concentrates a different kind of work. Opening the procfs file drives path resolution and kernel setup. Reading it moves data from kernel space to user space. Parsing it turns ASCII text into numbers with branch-heavy conversion logic.",
"code": [
{
"language": "cpp",
"caption": "1. `fread()` block",
"content": "statlen = fread(stat, 1, 2047, fp); // ~0.00010 mWh, ~300k uops (sys_read + copy + kernel formatting)\nstat[statlen] = '\\0'; // ~0.0000001 mWh, ~5 uops (store)\nfclose(fp); // ~0.00002 mWh, ~80k uops (sys_close + teardown)"
},
{
"language": "cpp",
"caption": "2. `fopen()` block",
"content": "os::snprintf_checked(proc_name, 64, \"/proc/self/task/%d/stat\", tid); // ~0.000002 mWh, ~5k uops (formatting)\nfp = os::fopen(proc_name, \"r\"); // ~0.00003 mWh, ~100k uops (open + VFS walk)\nif (fp == nullptr) return -1; // ~0.0000001 mWh, ~3 uops"
},
{
"language": "cpp",
"caption": "3. `sscanf()` block",
"content": "count = sscanf(s, \"%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu\", // ~0.00002 mWh, ~60k uops (parsing + conversions)\n &cdummy, &idummy, &idummy, &idummy, &idummy, &idummy,\n &ldummy, &ldummy, &ldummy, &ldummy, &ldummy, &user_time, &sys_time);\nif (count != 13) return -1; // ~0.0000001 mWh, ~5 uops"
}
]
},
{
"role": "user",
"stepNumber": 42,
"content": "So what changes in the better path?"
},
{
"role": "assistant",
"stepNumber": 43,
"slide": "Better Implementation",
"presentationStyle": "popup",
"content": "The better path asks the kernel directly for the right clock. Less parsing, less copying, fewer syscalls, and much better latency.",
"code": [
{
"language": "cpp",
"caption": "The optimized path.",
"content": "static bool get_thread_clockid(Thread* thread, clockid_t* clockid, bool total) {\n constexpr clockid_t CLOCK_TYPE_MASK = 3;\n constexpr clockid_t CPUCLOCK_VIRT = 1;\n\n int rc = pthread_getcpuclockid(thread->osthread()->pthread_id(), clockid);\n if (rc != 0) {\n assert_status(rc == ESRCH, rc, \"pthread_getcpuclockid failed\");\n return false;\n }\n\n if (!total) {\n *clockid = (*clockid & ~CLOCK_TYPE_MASK) | CPUCLOCK_VIRT;\n }\n\n return true;\n}\n\nstatic jlong user_thread_cpu_time(Thread* thread) {\n clockid_t clockid;\n bool success = get_thread_clockid(thread, &clockid, false);\n return success ? os::Linux::thread_cpu_time(clockid) : -1;\n}"
}
]
},
{
"role": "user",
"stepNumber": "43A",
"content": "Can you show that visually too?"
},
{
"role": "assistant",
"stepNumber": "43B",
"slide": "Better Implementation Visual",
"presentationStyle": "popup",
"content": "Yes. This visual shows the shift from the heavier procfs path to the more direct clock-based path.",
"openImageFullscreenAfterSpeech": true,
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image63.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": 44,
"content": "How should I use this code case in the talk?"
},
{
"role": "popup",
"stepNumber": 45,
"content": "Check it out later, not now. The code case should sharpen your eye, not pull attention away from your own systems.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image64.png",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": 46,
"content": "How do I turn this into backlog items?"
},
{
"role": "assistant",
"stepNumber": 47,
"slide": "Backlog Framing",
"content": "Map each waste item to yearly cost, energy or CO2, performance impact, and risk. That is how it becomes backlog-worthy."
},
{
"role": "user",
"stepNumber": "47A",
"content": "How do I phrase that as an outcome?"
},
{
"role": "assistant",
"stepNumber": 48,
"slide": "Outcome Language",
"content": "Do not pitch implementation details. Frame it as an outcome, like reducing infrastructure cost by consolidating underused workloads."
},
{
"role": "user",
"stepNumber": "48A",
"content": "What actions come first?"
},
{
"role": "assistant",
"stepNumber": 49,
"slide": "Quick Wins",
"content": "Start with safe quick wins. Not a platform revolution, but cleanup, consolidation, and right-sizing."
},
{
"role": "user",
"stepNumber": "49A",
"content": "How do teams make room for that work?"
},
{
"role": "assistant",
"stepNumber": 50,
"slide": "Capacity for Reduction",
"content": "Give it room to happen: reserve sprint capacity or a quarterly target. Otherwise urgent delivery will always win."
},
{
"role": "user",
"stepNumber": "50A",
"content": "Who should own it?"
},
{
"role": "assistant",
"stepNumber": 51,
"slide": "Ownership",
"content": "No owner means no living backlog item. Add labels, ownership, and a reason to revisit the work."
},
{
"role": "user",
"stepNumber": 52,
"content": "What happens if teams leave it alone?"
},
{
"role": "popup",
"stepNumber": 53,
"content": "If you do nothing, inefficiency keeps running: more cost, more energy use, and more systems slowly gathering dust.",
"media": [
{
"type": "image",
"src": ".pptx_extract/ppt/media/image65.jpeg",
"caption": ""
}
]
},
{
"role": "user",
"stepNumber": 54,
"content": "What decision framework should I leave with?"
},
{
"role": "assistant",
"stepNumber": 55,
"slide": "Frames",
"content": "Use three frames: value, cost, and exception. Ask who uses it, what it costs, and whether the trade-off is intentional."
},
{
"role": "user",
"stepNumber": "55A",
"content": "What choices does that lead to?"
},
{
"role": "assistant",
"stepNumber": 56,
"slide": "Choices",
"content": "Then choose: remove it, combine it, calibrate it, or consciously accept it with a named owner."
},
{
"role": "user",
"stepNumber": 57,
"content": "How should I start after this talk?"
},
{
"role": "assistant",
"stepNumber": 58,
"slide": "Get Started",
"content": "Start with one application. Ask what you already do, what blocks progress, and which system has the biggest user, compute, or cost impact."
},
{
"role": "user",
"stepNumber": 59,
"content": "What should I walk away with?"
},
{
"role": "popup",
"stepNumber": 60,
"content": "You can now spot digital waste, discuss workload quality, inspect code differently, and turn that insight into practical action."
}
]
}