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

真剣.js / shinken-js

Sho Kusano
February 08, 2017

真剣.js / shinken-js

Sho Kusano

February 08, 2017
Tweet

More Decks by Sho Kusano

Other Decks in Technology

Transcript

  1. 쎙 쎅 썰 썫 썦 썡썴썦썽 썙 쎡 썟 쎁

    썛 쎒 쎀 ஗ 썛 ͋ͷ೔ͷύονΛͳͨ͘͠੨೥ͷ૕ࣦͱ࠶ੜͷ෺ޠ
  2. > In some areas Go kann keep up with Java

    but when it comes to string > operations ("regex-dna" benchmark), Go is even much slower than Ruby > or Python. Is the status quo going to improve anytime soon? And why is > Go so terribly slow when it comes to string/RegEx operations? You assume the benchmark is worth something. First of all, Ruby and Python are using C implementations of the regexp search, so Go is being beat by C, not by Ruby. Second, Go is using a different algorithm for regexp matching than the C implementations in those other languages. The algorithm Go uses guarantees to complete in time that is linear in the length of the input. The algorithm that Ruby/Python/etc are using can take time exponential in the length of the input, although on trivial cases it typically runs quite fast. In order to guarantee the linear time bound, Go's algorithm's best case speed a little slower than the optimistic Ruby/Python/etc algorithm. On the other hand, there are inputs for which Go will return quickly and Ruby/Python/etc need more time than is left before the heat death of the universe. It's a decent tradeoff. http://swtch.com/~rsc/regexp/regexp1.html Russ at Golang-nuts IUUQTHSPVQTHPPHMFDPNGPSVNNTHHPMBOHOVUTENBFGK2ZH/:R3UT.+
  3. func Endpoint( rw http.ResponseWriter, req *http.Request, ) { bytes, err

    := json.Marshal(model) rw.Write(bytes) } Ұ౓CZUFTMJDFΛੜ੒ͯ͠͠·͍ͬͯΔ
  4. func Endpoint( rw http.ResponseWriter, req *http.Request, ) { encoder :=

    json.NewEncoder(rw) encoder.Encode(model) } CZUFTMJDF͕࡞ΒΕͳ͍