Oleg Andreev

Month
Filter by post type
All posts

Text
Photo
Quote
Link
Chat
Audio
Video
Ask

January 2009

Rant on reinvetion of HTTP four.livejournal.com
Jan 30, 2009
#http #rant #fastcgi #phusion #passenger #scgi #protocol
“Any work produced since March 1, 1989, with or without copyright notice, is under copyright until 70 years after the death of the author, or, again, in the in the case of works where the author is unknown or anonymous, until 95 years after their first publication or 120 years after their creation, whichever is shorter.”—What is Public Domain? — Freebase.com guidelines.
Jan 30, 2009
#copyright #public domain #reebase #guidlines #freedom #liberty
“When I’m writing code within an object, my mental model puts me as the object interacting with other objects and “self” is the natural english expression of this. The use of “this” instead suggests some external command issuer directing the object that may have a perspective on the system that is different and wider than the object’s perspective.”—Steve Dekorte on “This vs. Self”
Jan 30, 2009
#io #self #this #language #oop #perspective #mental model #dekorte
AutoGit zero-configuration ruby package managergithub.com
Jan 29, 2009
#git #ruby #package #library #github #zero-configuration #oss #open source
“The ONLY alternative to the spaghetti stack approach, for the world of mutable stack variables they present, is the “stack/heap strategy”. And all you do here is you start with a stack, just like in Potion, but as soon as a continuation is captured, you turn your stack into a DAG in the heap and you throw it the fuck away. That’s it.”—William Morgan on continuations implementation strategies (_why’s Potion github page)
Jan 28, 2009
#continuations #design #vm
“the entire system is a joint development and operations concern, but that instead of letting developers loose on the production system, operations people should be let loose on development”—http://www.hokstad.com/operations-is-a-development-concern.html
Jan 27, 2009
#management #operations #development #concerns
Jan 27, 20091 note
#ruby #code #picture #image
Statistics-based optimization strategy

Process consists of a number of phases. Each phase provides a feedback on its performance.

Instead of defining some performance threshold for each phase to start optimization at and asking ourselves “when should we start optimizing this?”, we should rather ask ourselves “which phase is to be optimized now?”. That is, we should collect all feedback, sort it and start optimizing most important phases first. Naturally, we end the process when we are not getting any visible performance gains anymore.

This strategy can be applied to dynamic programming language runtime as well as to any other controllable process.

Jan 23, 2009
#optimization
Method dispatch: hotspot metric

At each callsite (source code point, where method dispatch happens) we can count

1) number of calls to a method

2) time spent inside the method

3) time spent in callsite (total time across all methods called at the point).

Time can be measured either in byte code instructions, machine instructions or in microseconds.

Lets look at possible situations:

In real code, we don’t meet frequently called very slow methods: it is often done by bad design and could not be efficiently optimized in runtime. But this chart helps us to define a metric for “hot spot” identification: the place in the code, where we start runtime optimization.

Such “hotspot” metric would be callsite time * number of calls. The higher this number, the higher priority should be given to such callsite at optimization phase.

Why don’t we just start with a top-level method? If we start from the very top, we would spend enormous amount of time optimizing the whole program instead of really interesting parts.

Jan 23, 2009
#oop #optimization
Modular bash settings under Git controlgithub.com

Now i can easily bring my favorite aliases and commands to different environments: macbooks, linux and freebsd servers.

Jan 20, 2009
#bash #git
Ruby :symbols

Ruby symbols should be just immutable strings to avoid all that mess with string/symbol keys in option hashes. Just treat every literal string as immutable one. You could even keep this nice syntax with a colon to save some keystrokes.

So, basically:

String.should < ImmutableString
“symbol”.should == :symbol

Parser still fills a table of symbol when it encounters literal strings in the source code. So the unique number is just a string object_id.

When you compare two strings, you compare ids first and if they are not the same, you proceed with byte comparison. No need to convert :symbol.to_s.

How to make string a mutable one? Just #dup or #clone it.

“symbol”.dup.class.should == String

Jan 7, 2009
#ruby #strings #design #ideas
Next page →
20152016
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
201420152016
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
201320142015
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
201220132014
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
201120122013
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
201020112012
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
200920102011
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
200820092010
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
200720082009
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
200620072008
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
200520062007
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
200420052006
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
200320042005
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
200220032004
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
200120022003
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
200020012002
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
199920002001
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
199819992000
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
199719981999
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
199619971998
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
199519961997
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
199419951996
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
199319941995
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
199219931994
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
199119921993
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
199019911992
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
198919901991
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
198819891990
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
198719881989
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
198619871988
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
19861987
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December