Merb 0.3 released as gem
Posted by ezmobius Sun, 29 Apr 2007 04:03:00 GMT
Merb 0.3 is out in gem form peoples. I stayed up late last night hacking on merb trying to find a really annoying memory leak. In the process I refactored the class loading to be a noop in produciton mode and made frozen constants for most string’s merb uses over and over internally.
Before I was able to find the mem leak I had improved the performance of a merb hello world app from 298req/sec on my maccbook to a whopping 688req/sec on one process. Peep the numbers
Finished 15000 requests Server Software: Server Hostname: localhost Server Port: 4000 Document Path: /hello Document Length: 11 bytes Concurrency Level: 1 Time taken for tests: 21.784 seconds Complete requests: 15000 Failed requests: 0 Broken pipe errors: 0 Total transferred: 1965000 bytes HTML transferred: 165000 bytes Requests per second: 688.58 [#/sec] (mean) Time per request: 1.45 [ms] (mean) Time per request: 1.45 [ms] (mean, across all concurrent requests) Transfer rate: 90.20 [Kbytes/sec] received
Yup that’s 1.4ms average response time for a simple action that returns a “hello world!” string.. Of course full actions with templates and such are not as fast as this but this is the theoretical fastest request merb can serve that goes thru the full routing and dispatcher. This gives you a lot more headroom for your application code then rails does.
Anyway I finally tracked down the memory leak to an implementation of traits that I added recently. This bascially had the effect of retaining a reference to every controller ever instantiated. Ouch! I refactored away from traits and back to class_inheritable_attributes and killed the mem leaks so merb used a flatline 21Mb of ram even after 50k requests in a row.
Mrblog is being worked on again and I hope to have merb’s own site launched in time for railsconf.