Created
December 8, 2008 14:18
-
-
Save mstepniowski/33463 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Ruby | |
| [zuber@fish Projekty]$ ruby -v | |
| ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0] | |
| [zuber@fish Projekty]$ time ruby test.rb > /dev/null | |
| real 0m33.294s | |
| user 0m31.745s | |
| sys 0m0.303s | |
| # Python | |
| [zuber@fish Projekty]$ python -V | |
| Python 2.5.1 | |
| [zuber@fish Projekty]$ time python test.py > /dev/null | |
| real 0m4.995s | |
| user 0m4.854s | |
| sys 0m0.058s | |
| # Python po zmianie modułu etree na napisany w C | |
| # (from xml.etree import cElementTree as etree) | |
| [zuber@fish Projekty]$ time python test.py > /dev/null | |
| real 0m0.918s | |
| user 0m0.671s | |
| sys 0m0.045s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from xml.etree import ElementTree as etree | |
| st = 5000 | |
| for i in range(100): | |
| for j in range(st): | |
| d = etree.Element('GoogleCustomizations') | |
| etree.SubElement(d, 'Annotations') | |
| d = r = None | |
| print i * st |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rexml/document' | |
| include REXML | |
| st=5000 | |
| (0..100).each { |i| | |
| (0..st).each { |j| | |
| d = Document.new | |
| r = d.add_element 'GoogleCustomizations' | |
| r << Element.new('Annotations') | |
| # d = '<GoogleCustomizations><Annotations></GoogleCustomizations>' | |
| d,r=nil | |
| } | |
| puts i*st | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment