Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scala絵文字ライブラリに Macroなどを導入してみた

Shunsuke Tadokoro
August 01, 2017
1.1k

Scala絵文字ライブラリに Macroなどを導入してみた

Shunsuke Tadokoro

August 01, 2017
Tweet

More Decks by Shunsuke Tadokoro

Transcript

  1. 4DBMBֆจࣈϥΠϒϥϦʹ
    .BDSPͳͲΛಋೖͯ͠Έͨ

    !UPEPLS
    ָ͍͠ʂ

    View full-size slide

  2. ా ॴ ॣ ༎ ! U P E P L S
    w ݕ ࡧ Τ ϯ δ ϯ ࣄ ۀ ຊ ෦ Ϋ ϩ ʔ ϥ ʔ ։ ൃ
    w ࢓ ࣄ Ͱ ͸ 4 D B M B + B W B 4 D S J Q U 1 Z U I P O
    w ϓ ϥ Πϕ ʔ τ Ͱ ͸ $ M P K V S F $ M P K V S F 4 D S J Q U
    w ࣾ ಺ Ͱ ͸ ʮ จ ࣈ ί ʔ υ ͷ ਓ ʯ ͱ ͔ 

    ʮ ΤϞ δ χ Ξ ʯ ͱ ݺ ͹ Εͯ ͍ · ͢

    View full-size slide

  3. ా ॴ ॣ ༎ ! U P E P L S
    w ݕ ࡧ Τ ϯ δ ϯ ࣄ ۀ ຊ ෦ Ϋ ϩ ʔ ϥ ʔ ։ ൃ
    w ࢓ ࣄ Ͱ ͸ 4 D B M B + B W B 4 D S J Q U 1 Z U I P O
    w ϓ ϥ Πϕ ʔ τ Ͱ ͸ $ M P K V S F $ M P K V S F 4 D S J Q U
    w ࣾ ಺ Ͱ ͸ ʮ จ ࣈ ί ʔ υ ͷ ਓ ʯ ͱ ͔ 

    ʮ ΤϞ δ χ Ξ ʯ ͱ ݺ ͹ Εͯ ͍ · ͢

    View full-size slide

  4. ా ॴ ॣ ༎ ! U P E P L S
    w ݕ ࡧ Τ ϯ δ ϯ ࣄ ۀ ຊ ෦ Ϋ ϩ ʔ ϥ ʔ ։ ൃ
    w ࢓ ࣄ Ͱ ͸ 4 D B M B + B W B 4 D S J Q U 1 Z U I P O
    w ϓ ϥ Πϕ ʔ τ Ͱ ͸ $ M P K V S F $ M P K V S F 4 D S J Q U
    w ࣾ ಺ Ͱ ͸ ʮ จ ࣈ ί ʔ υ ͷ ਓ ʯ ͱ ͔ 

    ʮ ΤϞ δ χ Ξ ʯ ͱ ݺ ͹ Εͯ ͍ · ͢

    View full-size slide

  5. ࠷ۙ࡞ͬͨ΋ͷ
    w 6OJDPEFͷֆจࣈ਺
    ਐ਺Ͱ63-Λ୹ॖ
    w 1MBZ 4DBMB
    "844 &MBTUJD#FBOTUBML
    IUUQFNPKJVSMTIPSUFOFSDPN

    View full-size slide

  6. ࠷ۙ࡞ͬͨ΋ͷ
    w 6OJDPEFͷֆจࣈ਺
    ਐ਺Ͱ63-Λ୹ॖ
    w 1MBZ 4DBMB
    "844 &MBTUJD#FBOTUBML
    IUUQFNPKJVSMTIPSUFOFSDPN

    View full-size slide

  7. க໋తʜ
    w 5XFUUFS








    View full-size slide

  8. க໋తʜ
    w 5XFUUFS








    View full-size slide

  9. க໋తʜ
    w 5XFUUFS




    w 4MBDL




    View full-size slide

  10. க໋తʜ
    w 5XFUUFS




    w 4MBDL




    View full-size slide

  11. க໋తʜ
    w 5XFUUFS




    w 4MBDL




    ˠϦϯΫʹͳͬͯ͘Εͳ͍

    View full-size slide

  12. ࠓ೔͸4DBMBͷಛ௃తͳػೳͰ͋Δɺ

    View full-size slide

  13. ࠓ೔͸4DBMBͷಛ௃తͳػೳͰ͋Δɺ
    w *NQMJDJU$POWFSTJPO

    View full-size slide

  14. ࠓ೔͸4DBMBͷಛ௃తͳػೳͰ͋Δɺ
    w *NQMJDJU$POWFSTJPO
    w 4USJOH*OUFSQPMBUJPO

    View full-size slide

  15. ࠓ೔͸4DBMBͷಛ௃తͳػೳͰ͋Δɺ
    w *NQMJDJU$POWFSTJPO
    w 4USJOH*OUFSQPMBUJPO
    w .BDSP

    View full-size slide

  16. ࠓ೔͸4DBMBͷಛ௃తͳػೳͰ͋Δɺ
    w *NQMJDJU$POWFSTJPO
    w 4USJOH*OUFSQPMBUJPO
    w .BDSP
    ʹ͍ͭͯɺ

    ֆจࣈϥΠϒϥϦʮ&NPKJQPMBUJPOʯΛ୊ࡐʹɺ

    ػೳͷར༻ྫΛ঺հ͠·͢ɻ

    View full-size slide

  17. ࠓ೔͸4DBMBͷಛ௃తͳػೳͰ͋Δɺ
    w *NQMJDJU$POWFSTJPO
    w 4USJOH*OUFSQPMBUJPO
    w .BDSP
    ʹ͍ͭͯɺ

    ֆจࣈϥΠϒϥϦʮ&NPKJQPMBUJPOʯΛ୊ࡐʹɺ

    ػೳͷར༻ྫΛ঺հ͠·͢ɻ
    ϥΠϒϥϦ࡞੒ͳͲͷࢀߟʹͳΕ͹͏Ε͍͠Ͱ͢ɻ

    View full-size slide

  18. ͓࿩͢͠Δ͜ͱ
    w &NPKJQPMBUJPOͷ঺հ
    w ࣮૷ͷมભʹ͍ͭͯ
    w *NQMJDJU$POWFSTJPO
    w 4USJOH*OUFSQPMBUJPO
    w .BDSP
    w ϚΫϩಋೖલޙͷϕϯνϚʔΫൺֱ

    View full-size slide

  19. ͓࿩͠͠ͳ͍͜ͱ
    w 4DBMBͷந৅ߏจ໦ʹ͍ͭͯͷৄࡉ
    w EFGϚΫϩҎ֎ͷ.BDSPͷৄࡉ
    w ϝλϓϩάϥϛϯά༻ඪ४ϥΠϒϥϦTDBMBNFUB

    View full-size slide

  20. ΑΖ͓͘͠Ͷ͕͍͠·͢

    View full-size slide

  21. &NPKJQPMBUJPOʁ
    w 4DBMB͔Β6OJDPEFֆจࣈΛ؆୯ʹѻ͏ϥΠϒϥϦ
    w FNPKJKBWBͷϥούʔ

    IUUQTHJUIVCDPNWEVSNPOUFNPKJKBWB

    View full-size slide

  22. Ϟνϕʔγϣϯ
    w จࣈྻʹֆจࣈΛؾܰʹ࢖͍͍ͨ
    w ਐϦςϥϧͰॻ͘ͷ͸ඇৗʹͭΒ͍
    w େ఍ͷֆจࣈͷίʔυϙΠϯτ͸6'Ҏ্

    ˠαϩήʔτϖΞ

    View full-size slide

  23. Ϟνϕʔγϣϯ
    w จࣈྻʹֆจࣈΛؾܰʹ࢖͍͍ͨ
    w ਐϦςϥϧͰॻ͘ͷ͸ඇৗʹͭΒ͍
    w େ఍ͷֆจࣈͷίʔυϙΠϯτ͸6'Ҏ্

    ˠαϩήʔτϖΞ

    View full-size slide

  24. Ϟνϕʔγϣϯ
    w จࣈྻʹֆจࣈΛؾܰʹ࢖͍͍ͨ
    w ਐϦςϥϧͰॻ͘ͷ͸ඇৗʹͭΒ͍
    w େ఍ͷֆจࣈͷίʔυϙΠϯτ͸6'Ҏ্

    ˠαϩήʔτϖΞ

    View full-size slide

  25. Ϟνϕʔγϣϯ
    w จࣈྻʹֆจࣈΛؾܰʹ࢖͍͍ͨ
    w ਐϦςϥϧͰॻ͘ͷ͸ඇৗʹͭΒ͍
    w େ఍ͷֆจࣈͷίʔυϙΠϯτ͸6'Ҏ্

    ˠαϩήʔτϖΞ

    View full-size slide

  26. Ϟνϕʔγϣϯ
    w .BDͷֆจࣈΩʔϘʔυ͸࢖͍উख͕ྑ͍
    w $NE$USM4QBDF
    w ͕͔ͩ͠͠ʜ
    w 6OJDPEFͷΞοϓσʔτʹ௥͍͍͍ͭͯͳ͍
    w ͳͷͰɹɹͳͲ͕࢖͑ͳ͍
    w ϓϥΠϕʔτͷϚγϯ͕.BD͡Όͳ͍

    View full-size slide

  27. Ϟνϕʔγϣϯ
    w .BDͷֆจࣈΩʔϘʔυ͸࢖͍উख͕ྑ͍
    w $NE$USM4QBDF
    w ͕͔ͩ͠͠ʜ
    w 6OJDPEFͷΞοϓσʔτʹ௥͍͍͍ͭͯͳ͍
    w ͳͷͰɹɹͳͲ͕࢖͑ͳ͍
    w ϓϥΠϕʔτͷϚγϯ͕.BD͡Όͳ͍

    View full-size slide

  28. Ϟνϕʔγϣϯ
    w .BDͷֆจࣈΩʔϘʔυ͸࢖͍উख͕ྑ͍
    w $NE$USM4QBDF
    w ͕͔ͩ͠͠ʜ
    w 6OJDPEFͷΞοϓσʔτʹ௥͍͍͍ͭͯͳ͍
    w ͳͷͰɹɹͳͲ͕࢖͑ͳ͍
    w ϓϥΠϕʔτͷϚγϯ͕.BD͡Όͳ͍

    View full-size slide

  29. Ϟνϕʔγϣϯ
    w .BDͷֆจࣈΩʔϘʔυ͸࢖͍উख͕ྑ͍
    w $NE$USM4QBDF
    w ͕͔ͩ͠͠ʜ
    w 6OJDPEFͷΞοϓσʔτʹ௥͍͍͍ͭͯͳ͍
    w ͳͷͰɹɹͳͲ͕࢖͑ͳ͍
    w ϓϥΠϕʔτͷϚγϯ͕.BD͡Όͳ͍

    View full-size slide

  30. Ϟνϕʔγϣϯ
    w .BDͷֆจࣈΩʔϘʔυ͸࢖͍উख͕ྑ͍
    w $NE$USM4QBDF
    w ͕͔ͩ͠͠ʜ
    w 6OJDPEFͷΞοϓσʔτʹ௥͍͍͍ͭͯͳ͍
    w ͳͷͰɹɹͳͲ͕࢖͑ͳ͍
    w ϓϥΠϕʔτͷϚγϯ͕.BD͡Όͳ͍

    View full-size slide

  31. Ϟνϕʔγϣϯ
    w .BDͷֆจࣈΩʔϘʔυ͸࢖͍উख͕ྑ͍
    w $NE$USM4QBDF
    w ͕͔ͩ͠͠ʜ
    w 6OJDPEFͷΞοϓσʔτʹ௥͍͍͍ͭͯͳ͍
    w ͳͷͰɹɹͳͲ͕࢖͑ͳ͍
    w ϓϥΠϕʔτͷϚγϯ͕.BD͡Όͳ͍

    View full-size slide

  32. Ϟνϕʔγϣϯ
    w .BDͷֆจࣈΩʔϘʔυ͸࢖͍উख͕ྑ͍
    w $NE$USM4QBDF
    w ͕͔ͩ͠͠ʜ
    w 6OJDPEFͷΞοϓσʔτʹ௥͍͍͍ͭͯͳ͍
    w ͳͷͰɹɹͳͲ͕࢖͑ͳ͍
    w ϓϥΠϕʔτͷϚγϯ͕.BD͡Όͳ͍

    View full-size slide

  33. w ֆจࣈ͕؆୯ʹೖྗͰ͖ΔΑ͏ʹ

    View full-size slide

  34. Ϟνϕʔγϣϯ
    (JUIVCϥΠΫʹKPZͳͲͱॻ͚ΔΑ͏ʹ͍ͨ͠

    ˠFNPKJKBWBͷར༻
    String str = ":grinning:awesome :wink:emojis!";
    String result = EmojiParser.parseToUnicode(str);
    System.out.println(result);
    // "awesome emojis!"
    ͜ΕΛΑΓ4DBMBΒ͍͠ํ๏Ͱʂ

    View full-size slide

  35. ݱόʔδϣϯ·ͰͷಓͷΓ
    w W*NQMJDJU$POWFSTJPO
    w W4USJOH*OUFSQPMBUJPO
    w W.BDSP

    View full-size slide

  36. W

    *NQMJDJU$POWFSTJPO

    View full-size slide

  37. *NQMJDJU$POWFSTJPO֓ཁ
    ҉໧తʹܕม׵Λߦ͑ΔΑ͏ʹ͢Δػೳ
    ˠ%&.0

    View full-size slide

  38. *NQMJDJU$POWFSTJPO֓ཁ
    &OSJDI.Z-JCSBSZύλʔϯͰ

    طଘΫϥεʹϝιουΛ௥Ճ͢ΔʢΑ͏ʹݟ͔͚ͤΔʣ
    // Implicit ClassʹΑΔEnrich My Libraryύλʔϯ
    implicit class RichString(s: String) {
    def withSmile = s + ":)"
    }
    // new RichString("hello").withSmile
    "hello".withSmile
    // "hello:)"
    ˠ%&.0

    View full-size slide

  39. *NQMJDJU$POWFSTJPO࣮૷
    ͜ΕΛ&NPKJQPMBUJPOʹԠ༻͢Δ
    object Emojipolation {
    implicit class EmojizableString(s: String) {
    def toEmoji: String = EmojiParser.parseToUnicode(s)
    }
    }
    // ར༻ଆ
    import io.github.todokr.Emojipolation._
    "Hello! :joy:".toEmoji
    // Hello!

    View full-size slide

  40. *NQMJDJU$POWFSTJPOར༻ײ
    w 4USJOHΦϒδΣΫτʹϝιουΛ௥Ճ͢Δ͜ͱʹΑΓ

    ؆ܿʹֆจࣈม׵Λ࣮ݱ
    w ΋ͬͱ؆ܿͳํ๏͕͋ΔΑ͏ͳʜʁ

    View full-size slide

  41. *NQMJDJU$POWFSTJPOར༻ײ
    w 4USJOHΦϒδΣΫτʹϝιουΛ௥Ճ͢Δ͜ͱʹΑΓ

    ؆ܿʹֆจࣈม׵Λ࣮ݱ
    w ΋ͬͱ؆ܿͳํ๏͕͋ΔΑ͏ͳʜʁ
    IUUQTDBMJLFKECDPSHEPDVNFOUBUJPOTRMJOUFSQPMBUJPOIUNM

    View full-size slide

  42. W

    4USJOH*OUFSQPMBUJPO

    View full-size slide

  43. 4USJOH*OUFSQPMBUJPO֓ཁ
    w Ճ޻จࣈྻϦςϥϧ QSPDFTTFETUSJOHMJUFSBM
    ಺ʹ

    ม਺ΛຒΊࠐΉػೳ
    w ίϯύΠϥ͸͜ͷϦςϥϧʹରͯ͠ԿΒ͔ͷ௥ՃॲཧΛ࣮ߦ͢Δ

    View full-size slide

  44. 4USJOH*OUFSQPMBUJPO֓ཁ
    w Tิؒࢠม਺Λల։




    w Gิؒࢠ'PSNBUUFSͰ੔ܗ
    val name = "todokr"
    s"Hello, $name"
    // "Hello, todokr"
    val Pi: Double = 3.14159265359
    f"Pi is $Pi%1.2f"
    // "Pi is 3.14"

    View full-size slide

  45. 4USJOH*OUFSQPMBUJPO֓ཁ
    w 4USJOH*OUFSQPMBUJPOͷਖ਼ମ͸ͨͩͷϝιουݺͼग़͠

    View full-size slide

  46. 4USJOH*OUFSQPMBUJPO֓ཁ
    ίϯύΠϥ͕Ճ޻จࣈϦςϥϧΛݟ͚ͭΔ
    4USJOH$POUFYUΠϯελϯεͷϝιουݺͼग़͠ʹม׵


    ಠࣗͷ4USJOH*OUFSQPMBUJPOΛఆٛ͢Δʹ͸ 

    ˠJNQMJDJUΫϥεΛ࡞Γɺ4USJOH$POUFYUΫϥεʹಠࣗͷϝιουΛ௥Ճ͢Δ
    hoge"some text"
    (StringContextͷΠϯελϯε).hoge(…)

    View full-size slide

  47. 4USJOH*OUFSQPMBUJPO࣮૷
    ࣮૷ଆ
    object Emojipolation {
    implicit class EmojiImpl(val sc: StringContext) extends AnyVal {
    def emoji(args: Any*): String = {
    // Ճ޻จࣈϦςϥϧͷจࣈྻ෦෼͸

    // StringContextͷparts:Seq[String]ͱͯ͠ఏڙ͞ΕΔ
    // ࠓճ͸ศٓతʹઌ಄͚ͩΛѻ͏
    val rawString = sc.parts.head // "Hello! :joy:" etc
    EmojiParser.parseToUnicode(rawString)
    }
    }
    }
    import io.github.todokr.Emojipolation._
    emoji"Hello! :joy:"
    // Hello!
    ར༻ଆ

    View full-size slide

  48. 4USJOH*OUFSQPMBUJPO஫ҙ఺
    w ࣮ߦ࣌ͷΠϯελϯεԽΛආ͚ΔͨΊɺ"OZ7BMΛܧঝ͢Δ
    w ৄࡉ͸IUUQEPDTTDBMBMBOHPSHKBPWFSWJFXTDPSFWBMVFDMBTTFTIUNMΛࢀর
    implicit class XXX(val sc: StringContext) extends AnyVal {
    def someMethod(args: Any*): String = ???
    }

    View full-size slide

  49. 4USJOH*OUFSQPMBUJPOར༻ײ
    w ͞Βʹ؆ܿʹɺ4DBMBΒ͘͠ֆจࣈม׵Λ࣮ݱ
    w ຖճม׵ϝιου͕ݺͼग़͞ΕΔͷ͸
    scala> new EmojipolationTest().listEmojis
    converted!
    converted!
    converted!
    converted!
    converted!
    ...

    View full-size slide

  50. 4USJOH*OUFSQPMBUJPOར༻ײ
    w ͞Βʹ؆ܿʹɺ4DBMBΒ͘͠ֆจࣈม׵Λ࣮ݱ
    w ຖճม׵ϝιου͕ݺͼग़͞ΕΔͷ͸
    w ม׵͸ίϯύΠϧ࣌ʹߦ͍ɺ࣮ߦ࣌ͷΦʔόʔϔουΛͳ͍ͨ͘͠
    scala> new EmojipolationTest().listEmojis
    converted!
    converted!
    converted!
    converted!
    converted!
    ...

    View full-size slide

  51. .BDSP֓ཁ
    w ந৅ߏจ໦Λ૊Έସ͑ΔͨΊͷ࢓૊Έ
    w ந৅ߏจ໦ "45
    ίʔυͷҙຯΛද͢໦ߏ଄
    (pprint (macroexpand
    '(when (= color "blue")
    (println "Color is blue")
    (println "Not blue..."))))
    (if
    (= color "blue")
    (do (println "Color is blue") (println "Not blue...")))
    ࢀߟDMPKVSFͷXIFOϚΫϩΛల։

    View full-size slide

  52. .BDSP֓ཁ
    w 4DBMB͸ίϯύΠϧ࣌ʹϚΫϩΛల։͢Δ͜ͱ͕Ͱ͖Δ

    ˠίϯύΠϧ࣌ʹ೚ҙͷॲཧ͕࣮ߦͰ͖Δ
    w 2VJMM%#ΞΫηεϥΠϒϥϦ
    w ίϯύΠϧ࣌ʹ42-ੜ੒ɺόϦσʔγϣϯ
    w 4DBMBGNUίʔυϑΥʔϚοτϥΠϒϥϦ
    w ίϯύΠϧ࣌ʹίʔυͷϑΥʔϚοςΟϯά

    View full-size slide

  53. .BDSP֓ཁ"45ΛݟͯΈΔ
    // ϦϑϨΫγϣϯAPIͷΠϯϙʔτ
    import scala.reflect.runtime.universe._
    // qิؒࢠͰߏจ໦Λੜ੒
    val tree = q"""
    protected val x = 1
    private val y = 3
    x + y
    """
    // ϦϑϨΫγϣϯAPIͷshowRawͰՃ޻લͷߏจ໦Λग़ྗ
    showRaw(tree)

    View full-size slide

  54. .BDSP֓ཁ"45ΛݟͯΈΔ
    ਤʹ͢Δͱ͜͏
    #MPDL
    "QQMZ
    -JTU
    7BM%FG 7BM%FG
    .PEJpFST .PEJpFST
    5FSN/BNF 5FSN/BNF
    -JUFSBM -JUFSBM
    $POTUBOU $POTUBOU
    4FMFDU
    *EFOU
    -JTU
    5FSN/BNF
    *EFOU
    5FSN/BNF
    5FSN/BNF
    Y
    1305&$5&%

    13*7"5&
    Z

    Y
    QMVT
    Z

    View full-size slide

  55. .BDSP֓ཁ"45ͷ૸ࠪ
    ΍Γ͍ͨ͜ͱ
    $POTUBOU
    IFMMPKPZ
    $POTUBOU಺ͷจࣈྻΛՃ޻͠ɺ

    ߏจ໦ͱͯ͠໭͢
    $POTUBOU
    IFMMP
    ˠͲ͏΍ͬͯจࣈྻʹΞΫηε͢Δʁ

    View full-size slide

  56. .BDSP֓ཁ"45ͷ૸ࠪ
    w ύλʔϯϚονϯάΛ༻͍ͨ૸ࠪ
    w ؆୯
    w యܕతͳͷ͸୯ҰͷϊʔυΞΫηε͢Δ৔߹
    w 5SBWFSTFSͷαϒΫϥεΛ༻͍ͨ૸ࠪ
    w ߏจ໦શମΛ૸ࠪ͢Δ৔߹
    Apply( // ࠓճͷՃ޻จࣈϦςϥϧʹϚον
    _,
    List(
    Apply(
    _,
    List(
    Literal(Constant(s: String))
    )
    )
    )
    )

    View full-size slide

  57. .BDSP࣮૷
    object Emojipolation {
    // String Interpolationͷड෇෦
    implicit class EmojipolationImpl(val sc: StringContext) extends AnyVal {
    def emoji(_: Any*): String = macro impl // ࣮૷͸ϚΫϩ
    }
    // ϚΫϩͷ࣮૷෦
    def impl(c: blackbox.Context)(args: c.Expr[Any]*): c.Expr[String] = {
    import c.universe._
    c.prefix.tree match {
    // String InterpolationͰड͚ͱͬͨStringʹϚον
    case Apply(_,List(Apply(_,List(Literal(Constant(s: String)))))) =>
    // StringΛՃ޻͢Δߏจ໦ͱͯ͠ฦ͢
    c.Expr[String](q"${EmojiParser.parseToUnicode(s)}")
    case _ => c.abort(c.enclosingPosition, "Oops!")
    }
    }
    }

    View full-size slide

  58. .BDSPϕϯνϚʔΫ
    ֆจࣈϦςϥϧΛݸѻ͏ॲཧ

    KNISVOJXJGU

    View full-size slide

  59. .BDSPϕϯνϚʔΫ
    Non Macro

    [info] Benchmark Mode Cnt Score Error Units

    [info] Main.listEmojis thrpt 30 3.454 ± 0.303 ops/s

    ֆจࣈϦςϥϧΛݸѻ͏ॲཧ

    KNISVOJXJGU

    View full-size slide

  60. .BDSPϕϯνϚʔΫ
    Non Macro

    [info] Benchmark Mode Cnt Score Error Units

    [info] Main.listEmojis thrpt 30 3.454 ± 0.303 ops/s

    Macro

    [info] Benchmark Mode Cnt Score Error Units

    [info] Main.listEmojis thrpt 30 337491.727 ± 3268.895 ops/s
    ֆจࣈϦςϥϧΛݸѻ͏ॲཧ

    KNISVOJXJGU

    View full-size slide

  61. .BDSPϕϯνϚʔΫ
    Non Macro

    [info] Benchmark Mode Cnt Score Error Units

    [info] Main.listEmojis thrpt 30 3.454 ± 0.303 ops/s

    Macro

    [info] Benchmark Mode Cnt Score Error Units

    [info] Main.listEmojis thrpt 30 337491.727 ± 3268.895 ops/s
    ˠεϧʔϓοτ͕໿ ഒʹ
    ֆจࣈϦςϥϧΛݸѻ͏ॲཧ

    KNISVOJXJGU

    View full-size slide

  62. .BDSP஫ҙ఺
    IUUQLNJ[VIBUFOBCMPHDPNFOUSZ

    View full-size slide

  63. ·ͱΊ
    w *NQMJDJU$POWFSTJPOΛద੾ʹѻ͏͜ͱͰ

    ϝιουݺͼग़͠Λ؆ܿʹͰ͖Δ
    w ϦςϥϧϥΠΫʹԿ͔Λॻ͔͍ͤͨͳΒ

    4USJOH*OUFSQPMBUJPOͷ࠾༻Λݕ౼͠Α͏
    w ίϯύΠϧ࣌ʹ੩తʹ࣮ߦͰ͖ΔॲཧͳΒϚΫϩΛ࢖͍ɺ

    ࣮ߦ࣌ͷΦʔόʔϔουΛͳͦ͘͏

    View full-size slide

  64. ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View full-size slide

  65. ࢀߟࢿྉ
    w *NQMJDJU࠶ೖ໳!HBLV[[[[

    IUUQHBLV[[[[HJUIVCJPTMJEFTJNQMJDJU@SFJOUSPEVDUJPO
    w จࣈྻͷิؒ4DBMB%PDVNFOUBUJPO

    IUUQEPDTTDBMBMBOHPSHKBPWFSWJFXTDPSFTUSJOHJOUFSQPMBUJPOIUNM
    w ஋Ϋϥεͱ൚༻τϨΠτ4DBMB%PDVNFOUBUJPO

    IUUQEPDTTDBMBMBOHPSHKBPWFSWJFXTDPSFWBMVFDMBTTFTIUNM
    w EFGϚΫϩ4DBMB%PDVNFOUBUJPO

    IUUQEPDTTDBMBMBOHPSHKBPWFSWJFXTNBDSPTPWFSWJFXIUNM
    w 4DBMBͰίϯύΠϧ࣌ʹਖ਼نදݱΛνΣοΫ͢ΔʮϚΫϩ͔ͭ
    4USJOH*OUFSQPMBUJPOʯ!YVXFJ

    IUUQYVXFJLIBUFOBCMPHDPNFOUSZ

    View full-size slide