Reducing heap allocations on interface method calls

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • noescape

    Promise to the Go compiler that your Reads and Writes are well-behaved

  • So to use it I would have to write a function that calls Encrypt() interface method in assembly. There is even a github project that does exacly that but for io.Reader/io.Writer: https://github.com/lukechampine/noescape. But, I don't know assembly so writing another implementation just for cipher.Block interface didn't seem to be a good idea.

  • go

    The Go programming language

  • Nice find! Interfaces like this have long been a source of frustration for me. The decision to return an interface rather than a concrete type in much of the standard library -- especially in crypto packages -- was clearly a mistake, but it can't be changed now without breaking the 1.0 promise. There has been some work towards "devirtualizing" interfaces, but that will only work in certain cases.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts