31 ms·
This is directly analogous to memory allocation[1]. Your day is the heap of all available memory. "Manager time" is a small allocation. Since the manager's he
by munificent 11y ago
This is directly analogous to memory allocation[1].
Your day is the heap of all available memory.
"Manager time" is a small allocation. Since the manager's heap only uses blocks this size, she can do this all day without any problems or fragmentation.
"Maker time" is a large contiguous block. If the heap is empty, you can allocate them without any problem. But stick one manager-sized block in the middle and now you've split your heap such that the total time available is large enough, but it's not contiguous. Classic heap fragmentation[2].
pg's solution is the classic one in memory management: memory pools[3]. Partition your heap into regions for different-sized allocations. Small allocations always go in one region, large ones in another. "Office hours" is your small block allocator.
I often hear people say, "Look, I program in <high level language> with <giant standard library> all day. Why should I care about this old low level CS stuff? It's already been done for me!"
This is a great example to me of how those old concepts are still useful once you realize they are only a single analogy away from being about your new high level problem.
[1]: https://en.wikipedia.org/wiki/Memory_management https://en.wikipedia.org/wiki/Memory_management
[2]: https://en.wikipedia.org/wiki/Fragmentation_(computing)#External_fragmentation https://en.wikipedia.org/wiki/Fragmentation_(computing)#Exte...
[3]: http://gameprogrammingpatterns.com/object-pool.html http://gameprogrammingpatterns.com/object-pool.html
- stygiansonic 11y agoGreat analogy. I also liked this one, by Joel Spolsky, relating to context switching and the cost of multitasking: http://www.joelonsoftware.com/articles/fog0000000022.html http://www.joelonsoftware.com/articles/fog0000000022.html
- ryangittins 11y agoHah, wow. What a great reply. Props to you, man. That's just a terrific analogy.
- deleted 11y ago[deleted]