Earlier quoted context omitted.
What the hell is C-Like Python?
Python that looks like C? It's not a thing, I just made it up. A subset of Python that is not too painful to rewrite in C. No classes, I use namedtuples as structs, etc. I'm not sure it's a sane thing to do, arguably I should just write the thing in C in the first place, but I have more experience with Python so it's still easier to me.
Malloc Challenge
31–40 of 109 posts
Re: Malloc Challenge
#32J/K. I think this is an interesting problem in that its a sandbox for allocation and GC in pretty much any dynamic interpreter's implementation. My qualm is that it would be "easy" to tune for the test. Consider the difference between dynamic blocks of a small but fixed size, getting alloc'd/freed in an asynchronous way (a network stack?) versus a pool of variable byte length strings getting shuffled around (a key/value store?). Those are simple, but drastically different, strategies for your heap. There won't be a "best" answer besides the limits of your problem domain.
Re: Malloc Challenge
#33Re: Malloc Challenge
#34Earlier quoted context omitted.
Python that looks like C? It's not a thing, I just made it up. A subset of Python that is not too painful to rewrite in C. No classes, I use namedtuples as structs, etc. I'm not sure it's a sane thing to do, arguably I should just write the thing in C in the first place, but I have more experience with Python so it's still easier to me.
Python does not look like C. The first thing I can think of is using traditional loop counters instead of the for..in construct.
Rewriting a for..in as a for with counters is relatively trivial, compared to re-implementing a complex class hierarchy in C.
You can write procedural Python, and it will look kinda like C if you squint. Cython even lets you use C types directly, with a simple syntax. As I said, maybe not the sanest thing to do, everything is an object in Python so you can never really get away from it's object-oriented nature.
Re: Malloc Challenge
#35Earlier quoted context omitted.
Somebody out there is doing this in production. I guarantee it.
Why wouldn't they? If it turns out to be a good solution for the problem they're trying to solve? There's nothing wrong with coming up with your own solutions, that's why we got brains instead of answering machines.
Re: Malloc Challenge
#36Re: Malloc Challenge
#37Let's all just agree to use Perl. It's just dynamic, functional, OOPy C isn't it? J/K. I think this is an interesting problem in that its a sandbox for allocation and GC in pretty much any dynamic interpreter's implementation. My qualm is that it would be "easy" to tune for the test. Consider the difference between dynamic blocks of a small but fixed size, getting alloc'd/freed in an asynchronous way (a network stack…
Agreed. Which is why the 'one size fits all' approach might not be the best way to go. The main reason I decided to launch the challenge, and encourage a more combinatory approach with local special purpose allocators.
Re: Malloc Challenge
#38- http://locklessinc.com/benchmarks_allocator.shtml ($, use as a minimum performance target)
- http://www.nedprod.com/programs/portable/nedmalloc/
- http://phk.freebsd.dk/pubs/malloc.pdf [PDF] (phkmalloc)
- https://github.com/gperftools/gperftools (tcmalloc)
- https://github.com/ivmai/bdwgc/blob/master/malloc.c
- https://github.com/jemalloc/jemalloc
- http://gee.cs.oswego.edu/dl/html/malloc.html (dlmalloc)
Re: Malloc Challenge
#39All past 15-213 students go in search of their malloc lab solution.
Current 15-213 student here in the middle of malloc lab, my current solution is probably worse than anything in that link (left unclicked).
Re: Malloc Challenge
#40A malloc benchmark that doesn't measure multithreaded performance is worse than useless.