Created
August 2, 2011 15:24
-
-
Save xuwei-k/1120411 to your computer and use it in GitHub Desktop.
ClassFileのByte数を簡単に取得する方法
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
Welcome to Scala version 2.9.0.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import scala.tools.scalap.scalax.rules.scalasig._ | |
import scala.tools.scalap.scalax.rules.scalasig._ | |
scala> ByteCode.forClass(classOf[List[_]]) | |
res0: scala.tools.scalap.scalax.rules.scalasig.ByteCode = 82729 bytes | |
scala> 0 to 22 foreach {n => println("Function" + n + " " + ByteCode.forClass(Class.forName("scala.Function" + n )))} | |
Function0 991 bytes | |
Function1 4530 bytes | |
Function2 9755 bytes | |
Function3 1495 bytes | |
Function4 1607 bytes | |
Function5 1720 bytes | |
Function6 1832 bytes | |
Function7 1944 bytes | |
Function8 2056 bytes | |
Function9 2169 bytes | |
Function10 2296 bytes | |
Function11 2420 bytes | |
Function12 2544 bytes | |
Function13 2669 bytes | |
Function14 2794 bytes | |
Function15 2918 bytes | |
Function16 3044 bytes | |
Function17 3190 bytes | |
Function18 3315 bytes | |
Function19 3446 bytes | |
Function20 3578 bytes | |
Function21 3709 bytes | |
Function22 3841 bytes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment