The Cost of Dynamism in Static Languages for Image Processing
summary
Paper evaluates a model that couples static genericity with a dynamic layer based on type erasure, implementing images as either templated buffers or erased-value objects accessed through std::function. Benchmarks in C++/Rust use three kernels (element-wise max, dilation, max3) and show that each added dynamic indirection increases runtime cost, prevents inlining and autovectorization, and that overhead depends on the algorithmic scheme; full monomorphization explodes binary size; results drive a Python bridge and future domain-erasure work.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:04Image processing library goals
- 3:14Image interface
- 5:45Static genericity costs
- 7:31Type erasure for values
- 10:00Image algorithm implementation
- 12:26Algorithm performance
- 14:30Conclusions and future work
- 15:36Q&A
- 16:39Runtime specialization
- 17:43Neural networks limits
related talks
01h 07mDynamic Polymorphism With Code Injection and Metaclasses
01h 23mRethink Polymorphism in C++
50mC++ Costless Abstractions: the compiler view
55mBreaking Dependencies: Type Erasure - The Implementation Details
40mBack to Basics: Virtual Dispatch and its Alternatives
57mFast and Small - What are the Costs of Language Features
57mA Tour of Polymorphism Techniques in C++
58mBetter Code: Runtime Polymorphism
