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
| (original: http://furukawablog.spaces.live.com/Blog/cns!1pmWgsL289nm7Shn7cS0jHzA!2225.entry) | |
| (archived: https://web.archive.org/web/20061105073147/http://furukawablog.spaces.live.com/Blog/cns!1pmWgsL289nm7Shn7cS0jHzA!2225.entry) | |
| November 04 | |
| 私のマイコン遍歴、日本のパソコン30年史、その1 | |
| 私がその昔、秋葉原少年だった頃(今のアキバ系とちょっと違うとは思うのだけど、まぁ普通の人から見ると同類項だったのかな?)秋葉原にはアスターインターナショナル、コンピュータLab、若松通商、ビットイン、本田通商、そして新宿のムーンベース、タンディ・ラジオシャック、御苑前のアスターインターナショナル本店などに当時のマイコン少年は毎日たむろしていたのでした。 | |
| 当時はTK-80、KIM-1、SCAMP、HitachiやL-Kit16などの10万円ほどする、いわゆるワンボードマイコンが全盛期でありました。Altair、IMSAI、SOL-20、Horizon North Star、クロメムコといったS-100バスのコンピュータはテレタイプに紙テープで操作するもので50万から80万円、8インチのフロッピー・ディスクを搭載したものが100万から150万円もする時代でありました。(ご参考までに、大卒初任給は10万円ぐらいの時代のことです。) |
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 --disable-gems test.rb | |
| {:T_HASH=>1, :T_DATA=>2} | |
| {:T_ARRAY=>1, :T_HASH=>1, :T_DATA=>1} |
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 'fiddle' | |
| def create_large_string(size) | |
| func = Fiddle::Function.new(Fiddle::Handle::DEFAULT['rb_str_new'], [Fiddle::TYPE_VOIDP,Fiddle::TYPE_LONG], Fiddle::TYPE_VOIDP) | |
| # returns fast on environments whose malloc delays the actual allocation | |
| ptr = func.call(nil, size) | |
| end |
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
| 2016-09-12 07:02:10 +0900 | |
| target 0: ruby 2.4.0dev (2016-07-22 trunk 55727) [x86_64-linux] at "./miniruby55727 -I./lib -I. -I.ext/common --disable-gem" | |
| target 1: built-ruby (ruby 2.4.0dev (2016-09-11) [x86_64-linux]) at "./miniruby -I./lib -I. -I.ext/common --disable-gem" | |
| measure target: real | |
| ----------------------------------------------------------- | |
| app_answer | |
| def ack(m, n) | |
| if m == 0 then |
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
| #!/usr/bin/env ruby | |
| require 'pp' | |
| files = {'vm.inc' => [], 'insns.def' => []} | |
| current_insn = nil | |
| current_filename = 'vm.inc' | |
| lineno_offset = 0 | |
| IO.foreach('vm.inc') do |line| | |
| case line | |
| when /^INSN_ENTRY\((\w+)\)/ |
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
| Original: | |
| Performance counter stats for './miniruby -e@v=42; n=100_000_000;while n>0; x=@v; x=@v; x=@v; n-=1;end': | |
| 5675.422561 task-clock (msec) # 0.998 CPUs utilized | |
| 159 context-switches # 0.028 K/sec | |
| 2 cpu-migrations # 0.000 K/sec | |
| 889 page-faults # 0.157 K/sec | |
| 16521817067 cycles # 2.911 GHz | |
| 4121915626 stalled-cycles-frontend # 24.95% frontend cycles idle |
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
| #!/usr/bin/env ruby | |
| # | |
| # pid2line.rb | |
| # | |
| # Show source files and line numers of given process's threads | |
| # | |
| # This script works only on Linux. | |
| # https://gist.github.com/nurse/0619b6af90df140508c2 | |
| # |
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
| % time ./miniruby -e'a=100;i=0;while i<0xffffff;i+=1;a*=557;a+=2;a%=100000;end' | |
| ./miniruby -e'a=100;i=0;while i<0xffffff;i+=1;a*=557;a+=2;a%=100000;end' 2.64s user 0.01s system 99% cpu 2.649 total | |
| % ruby -e'puts RubyVM::InstructionSequence.compile(%q{a=100;i=0;while i<0xffffff;i+=1;a*=557;a+=2;a%= | |
| 100000;end}).disasm' | |
| == disasm: #<ISeq:<compiled>@<compiled>>================================ | |
| == catch table | |
| | catch type: break st: 0015 ed: 0060 sp: 0000 cont: 0060 | |
| | catch type: next st: 0015 ed: 0060 sp: 0000 cont: 0012 | |
| | catch type: redo st: 0015 ed: 0060 sp: 0000 cont: 0015 | |
| |------------------------------------------------------------------------ |
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
| resources: | |
| - type: package | |
| name: zsh | |
| - type: package | |
| name: screen | |
| - type: package | |
| name: subversion | |
| - type: group | |
| name: <%= user %> |
NewerOlder