Performance issue with Graticule when calculating distanses.
------------------------------------------------------------
Key: JRUBY-2437
URL: http://jira.codehaus.org/browse/JRUBY-2437
Project: JRuby
Issue Type: Bug
Components: Performance
Affects Versions: JRuby 1.1.1
Environment: Mac OS X Leopard 10.5.2, Java 1.6 & 1.5, Macbook Pro
Intel Core 2 Duo 2.2Ghz
Reporter: Nikos Dimitrakopoulos
Attachments: cities.yml, rvm_comparisons_eu_cities_dist.png
Running the following benchmark we see that JRuby is 50% slower than MRI and
YARV in this example.
\\
{code}
require 'benchmark'
require 'yaml'
require 'graticule'
class DistanceCalculationBenchmarks
def self.european_cities(print_results = false)
Benchmark.bmbm do |x|
x.report("Largest european cities tour:") {
5.times do
locations = YAML.load_file('cities.yml')
costs = {}
locations.each_index do |loc|
costs[loc] = {}
end
locations.each_index do |loc_a|
locations.each_index do |loc_b|
if loc_a != loc_b and costs[loc_a][loc_b] == nil
d = locations[loc_a].distance_to(locations[loc_b])
costs[loc_a][loc_b] = costs[loc_b][loc_a] = d
end
end
end
end
}
end
end
end
DistanceCalculationBenchmarks.european_cities
{code}
\\
The results:
\\
!rvm_comparisons_eu_cities_dist.png!
\\
For more info see
[here|http://nikos-d.blogspot.com/2008/04/more-speed-comparisons-of-ruby-18-ruby.html].
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email