Skip to content

Instantly share code, notes, and snippets.

View yegor256's full-sized avatar
😀
reinventing OOP...

Yegor Bugayenko yegor256

😀
reinventing OOP...
View GitHub Profile
@yegor256
yegor256 / cost-of-malloc.md
Last active July 29, 2023 21:30
How many CPU ticks a malloc() costs?

Cost of malloc

How many CPU ticks it costs to allocate a piece of memory in heap via malloc()?

TL;DR Around 200 ticks.

Here is the code:

#include <iostream>
@yegor256
yegor256 / Agents.java
Last active February 18, 2022 19:02
Object-oriented dependency injection
final Agent agent = new Agent.Iterative(
new Array<Agent>(
new Understands(
this.github,
new QnSince(
49092213,
new QnReferredTo(
this.github.users().self().login(),
new QnParametrized(
new Question.FirstOf(
@yegor256
yegor256 / keybase.md
Created May 2, 2016 16:44
keybase.md

Keybase proof

I hereby claim:

  • I am yegor256 on github.
  • I am yegor256 (https://keybase.io/yegor256) on keybase.
  • I have a public key ASDIUlRwZERl47w7DgZXmyiI5INXc0pQyfYDd3aFsLWupAo

To claim this, I am signing this object: