Kurt StephensNerd Up! | ||||||||||||||||||
rubyRuby: Fixnum#gcd accepted into MRI
Ruby rational.rb clean-up and the Fixnum#gcd primitive was refactored into a new MRI extension. Fixnum#gcd is now defined during require ‘rational’. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?... http://redmine.ruby-lang.org/issues/show/2561 See http://kurtstephens.com/node/34 . Emacs Flymake Ruby Mode
Adds automatic syntax checking and error highlighting to Ruby code: http://github.com/purcell/emacs.d/raw/master/site-lisp/flymake-ruby/flym... Ruby 1.8: Improved Rational performance by 15%
This should also speed up DateTime. This will not help 1.9 performance. The attached file is based on MRI 1.8.6 rational.rb.
> ruby rational_performance.rb
user system total real
test_it 32.930000 3.030000 35.960000 ( 35.971832)
test_it 33.840000 2.910000 36.750000 ( 36.758585)
test_it ks_rational 29.110000 2.460000 31.570000 ( 31.572762)
Overview:
Ruby: Caching #to_s for immutables (and a possible future for constant-folding)
Reference: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/26869 I have a proof-of-concept patch to MRI that caches It reduces the number of It requires a minor semantic change to Ruby core. This minor change could cascade into a huge performance improvement for all Ruby implementations — as will be illustrated later: #to_s may return frozen cabar - An Extensible Software Component Mangement System
Cabar – an extensible software component backplane for managing software components. http://github.com/kstephens/cabar/tree/master Ruby: Performance of Symbol Construction
Measurements of Symbol Constructor Expressions. n=10_000_000 ruby 1.8.6 (2008-08-08 patchlevel 286) [i686-linux]:
> /cnu/bin/ruby symbol_benchmark.rb
user system total real
Null Test 0.740000 0.000000 0.740000 ( 0.742914)
'foo_bar' 1.670000 0.000000 1.670000 ( 1.661374)
"foo_bar" 1.620000 0.000000 1.620000 ( 1.625221)
:foo_bar 0.890000 0.000000 0.890000 ( 0.886903)
:'foo_bar' 0.880000 0.000000 0.880000 ( 0.878555)
<br class="clear" />
How to duplicate DataMapper objects
How to create a deep clone of a DataMapper::Resource object so it can be stored in a different repository. This does not work:
obj = Foo.first
obj = obj.dup
repository(:other) { obj.save }
<br class="clear" />
Ruby DataMapper : dm-more Gem cannot be installed
dm-more depends on merb_datamapper (!?!) version 0.9.3 which does not appear to exist yet: ++ gem install dm-more ERROR: Error installing dm-more: dm-more requires merb_datamapper (= 0.9.3, runtime) Not sure what to do about it. |
||||||||||||||||||
Recent comments
1 week 3 days ago
3 weeks 6 days ago
4 weeks 17 hours ago
4 weeks 18 hours ago
4 weeks 20 hours ago
4 weeks 23 hours ago
6 weeks 3 days ago
6 weeks 3 days ago
9 weeks 4 hours ago
9 weeks 17 hours ago