Skip to Content
Programmation C# 10
book

Programmation C# 10

by Ian Griffiths
November 2024
Intermediate to advanced
836 pages
29h 1m
French
O'Reilly Media, Inc.
Content preview from Programmation C# 10

Chapitre 18. Efficacité de la mémoire

Cet ouvrage a été traduit à l'aide de l'IA. Tes réactions et tes commentaires sont les bienvenus : translation-feedback@oreilly.com

Comme nous l'avons décrit au chapitre 7, le CLR de est capable d'effectuer une gestion automatique de la mémoire grâce à son garbage collector (GC). Cela a un prix : lorsqu'une unité centrale passe du temps sur le ramasse-miettes, cela l'empêche de se consacrer à des tâches plus productives. Sur les ordinateurs portables et les téléphones, le travail du GC draine l'énergie de la batterie. Dans un environnement de Cloud computing où tu peux payer le temps de l'unité centrale en fonction de la consommation, le travail supplémentaire de l'unité centrale correspond directement à une augmentation des coûts. Plus subtilement, sur un ordinateur doté de nombreux cœurs, passer trop de temps dans le GC peut réduire considérablement le débit, car de nombreux cœurs peuvent se retrouver bloqués, attendant que le GC se termine avant de pouvoir continuer.

Dans de nombreux cas, ces effets sont suffisamment faibles pour ne pas causer de problèmes visibles. Cependant, lorsque certains types de programmes sont fortement sollicités, les coûts du GC peuvent en venir à dominer le temps d'exécution global. En particulier, si tu écris un code qui effectue un traitement relativement simple mais très répétitif, les frais généraux du GC peuvent avoir un impact substantiel sur le débit.

Pour te donner un exemple du type d'améliorations qui ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

La programmation orientée objet

La programmation orientée objet

Hugues Bersini
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer
How to Overcome a Power Deficit

How to Overcome a Power Deficit

Cyril Bouquet, Jean-Louis Barsoux

Publisher Resources

ISBN: 9798341618718