Skip to content

Instantly share code, notes, and snippets.

View lilith's full-sized avatar
🎯
Focusing

Lilith River lilith

🎯
Focusing
  • Imazen
  • Broomfield, CO
  • 09:24 (UTC -06:00)
View GitHub Profile
@lilith
lilith / craft_and_synthesis.md
Last active August 20, 2023 23:15
craft_and_synthesis

Craft & Synthesis: Creating Software With Less Waste

Introduction

This is a book born of mistakes, of failures - my own and others - of paths trodden that are better left alone, and of tidbits of wisdom that, I hope, will help you reach your goals faster and with less regret. Also: empathy is the best productivity hack, which I’ll explain later.

It’s not exclusively a coding book - it’s an “everything else” book so that when you do write code, you’re solving the right problems at the right time and in the right way for that specific context.

I have no credentials to offer, but programming language design and related philosophies have been my special interest for 22 years. I’ve been creating and shipping projects solo since I was a wee thing, and I have read tens of millions of lines of code.

have_header: checking for vm_core.h... -------------------- yes
LD_LIBRARY_PATH=.:/home/lilith/.rbenv/versions/3.1.2/lib "gcc -o conftest -I/home/lilith/.rbenv/versions/3.1.2/include/ruby-3.1.0/x86_64-linux -I/home/lilith/.rbenv/versions/3.1.2/include/ruby-3.1.0/ruby/backward -I/home/lilith/.rbenv/versions/3.1.2/include/ruby-3.1.0 -I. -I/home/lilith/.rbenv/sources/3.1.2/ruby-3.1.2 -I/home/lilith/.rbenv/versions/3.1.2/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Wundef -fPIC conftest
#ifndef cheddar_generated_imageflow_h
#define cheddar_generated_imageflow_h
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
Using imageflow to thumbnail 32 images in parallel
0.19user 0.15system 0:00.71elapsed 48%CPU (0avgtext+0avgdata 19420maxresident)k
8inputs+928outputs (0major+42591minor)pagefaults 0swaps
Using libvips to thumbnail 32 images in parallel
10.91user 1.55system 0:03.52elapsed 353%CPU (0avgtext+0avgdata 68336maxresident)k
2264inputs+7264outputs (47major+392240minor)pagefaults 0swaps
using System;
using System.Collections.Generic;
using System.Drawing;
using Xunit;
using Xunit.Abstractions;
namespace AspectTesting
{
@lilith
lilith / 2016-06-10-benchmarks.txt
Last active May 27, 2017 17:09
2016-06-10 benchmarks of libimageflow on Ubuntu 14.04 workstation. See www.imageflow.io
Use wrappers/server/bench.sh to reproduce
https://github.com/imazen/imageflow/commit/f05efb89f993827936693e98d39adb31057ec270
Run on a 4-core Xeon E3-1275 v5 with 32GB of ram.
https://gist.github.com/nathanaeljones/1a4394f994a542957f89a674ec83312b
This benchmark is for ubuntu 14.04.
Compiling imageflow-server v0.1.0 (file:///home/n/Documents/imazen/imageflow/wrappers/server)
Version: ImageMagick 6.9.3-7 Q16 x86_64 2016-05-04 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
use ::std::cell::*;
/// Provides interior mutability for a add-only set.
/// Items can be added (a reference is returned)
/// References can be looked up via a pointer to the item
#[derive(Debug,Clone, PartialEq)]
pub struct AppendOnlySet<T>{
slots: RefCell<Vec<Box<T>>>
}
impl<T> AppendOnlySet<T> {
<nathanael> Why does rust care about lifetime bounds on pointers to generic types?
<delma> iamrohit7: yes if you represent graph like that
* rschiffl1n has quit (Ping timeout: 121 seconds)
<Moonlightning> iamrohit7: I guess. And to remove a node, you'd...have to travel to each of its neighbors in turn, removing that edge and the dropping neighbor's Rc holding self, and then use Rc::try_unwrap()
<delma> there is other reprentantions too
<Moonlightning> Or...unsafe black magic
* mou has quit (Ping timeout: 121 seconds)
<Moonlightning> dinfuehr: names instead of just ids?
<nathanael> Ex: https://gist.github.com/nathanaeljones/80792ff3ffb5854f7a18ba40f60c6770
<Moonlightning> dinfuehr: AFAIK, Display is only for types that have a single obvious human-readable representation. It's not implemented for most types.
#ifndef cheddar_generated_imageflow_pinvoke_h
#define cheddar_generated_imageflow_pinvoke_h
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#![feature(alloc)]
#![feature(oom)]
pub mod ffi;
pub mod boring;
pub mod parsing;
#[macro_use]
extern crate json;