GithubHelp home page GithubHelp logo

alexurmi / refsemantics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from citizenmatt/refsemantics

0.0 1.0 0.0 503 KB

Slides and sample code from "Writing Allocation Free Code in C#" talk

License: Apache License 2.0

C# 100.00%

refsemantics's Introduction

Writing Allocation Free Code in C# samples

This repo contains the slides and example code from my "Writing Allocation Free Code in C#" talk. The talk covers why it is important to reduce allocations when possible (spoiler - for throughput), and demonstrates this with a look at "reference semantics for value types", which is a set of features in C# 7.3 for being able to handle value types (struct) as references, allowing very cheap allocation and cleanup of objects on the stack, without the cost of having to pass by value, and with the ability to modify the passed values (or make them immutable). More details of this feature can be found in the Microsoft documentation.

It also looks at Span<T> a type used to represent any block of contiguous memory and provide a type safe array-like API for accessing and modifying that data. This type allows for creating and manipulating allocation free slices of existing data, such as sub-strings. More details on Span<T> can be found in this article.

refsemantics's People

Contributors

citizenmatt avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.