3 ms·
The main issue would be fixing the problem of pointers; high-performance code is hard to write in C because of pointer aliasing. Rust has an interesting approa
by theseoafs 11y ago
The main issue would be fixing the problem of pointers; high-performance code is hard to write in C because of pointer aliasing. Rust has an interesting approach in its ownership model but I think a performance-oriented C evolution would require another more general solution.
- ori_b 11y agoIn Myrddin[1], the code is amenable to loop versioning -- All references are bounded, one way or the other. Either you have a raw pointer, which is bounded by the size of the type, or you have a slice, which carries with it a length. This allows you (or the compiler) to trivially write an 'aliases(a, b)' predicate, which allows the compiler to write something like: if aliases(a, b) slowpath else fastpath ;; Considering that this language seems to also keep track of bounds on the pointers, you could probably do something similar. [1]http://eigenstate.org/myrddin/ http://eigenstate.org/myrddin/
- aidenn0 11y agoANSI rules for aliasing, plus the restrict keyword go a long way to address this.
- danieltillett 11y agoYes. Pointers are only a problem if you do things with them that confuses the compiler. As someone who writes C code that needs maximum performance (my problem is cpu bound) the two biggest performance gains were moving to icc (Intel’s compiler) and writing my own thread-safe memory pool allocator to avoid malloc.
- arthurcolle 11y agoWhat are your use cases that require this kind of performance? High performance order matching or other trading/financial applications?
- danieltillett 11y agoDNA sequencing data processing [1]. It is a hard problem that needs a lot of processing power thrown at it to solve. 1. https://www.nucleics.com/peaktrace/peaktrace-basecaller-overview.html https://www.nucleics.com/peaktrace/peaktrace-basecaller-over...