{"action":"created","issue":{"url":"https://api.github.com/repos/sbt/util/issues/151","repository_url":"https://api.github.com/repos/sbt/util","labels_url":"https://api.github.com/repos/sbt/util/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/sbt/util/issues/151/comments","events_url":"https://api.github.com/repos/sbt/util/issues/151/events","html_url":"https://github.com/sbt/util/issues/151","id":297694876,"number":151,"title":"TypeTag materialization, stringification appears to be a significant overhead in logging API","user":{"login":"retronym","id":65551,"avatar_url":"https://avatars0.githubusercontent.com/u/65551?v=4","gravatar_id":"","url":"https://api.github.com/users/retronym","html_url":"https://github.com/retronym","followers_url":"https://api.github.com/users/retronym/followers","following_url":"https://api.github.com/users/retronym/following{/other_user}","gists_url":"https://api.github.com/users/retronym/gists{/gist_id}","starred_url":"https://api.github.com/users/retronym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retronym/subscriptions","organizations_url":"https://api.github.com/users/retronym/orgs","repos_url":"https://api.github.com/users/retronym/repos","events_url":"https://api.github.com/users/retronym/events{/privacy}","received_events_url":"https://api.github.com/users/retronym/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-16T06:46:04Z","updated_at":"2018-02-16T07:09:14Z","closed_at":null,"author_association":"OWNER","body":"```scala\r\n  def logEvent[A: JsonFormat: TypeTag](level: Level.Value, event: => A): Unit = {\r\n    val v: A = event\r\n    val tag = StringTypeTag[A]\r\n    LogExchange.getOrElseUpdateJsonCodec(tag.key, implicitly[JsonFormat[A]])\r\n    // println(\"logEvent \" + tag.key)\r\n    val entry: ObjectEvent[A] = ObjectEvent(level, v, channelName, execId, tag.key)\r\n    xlogger.log(\r\n      ConsoleAppender.toXLevel(level),\r\n      new ObjectMessage(entry)\r\n    )\r\n  }\r\n\r\n```\r\n\r\nI don't quite know whether to believe what I'm seeing here:\r\n\r\n![image](https://user-images.githubusercontent.com/65551/36296438-01673266-1339-11e8-8ce9-29b279992b34.png)\r\n\r\n\r\nbut it suggests far too much time is spent logging (only 12k samples were spent in scalac and zinc)\r\n\r\n`ManagedLogger.success` could be tunneled through to a version of `logEvent` that accepted a pre-stringified `tag`, rather than a `TypeTag`.\r\n\r\nI'd really suggest use of `ClassTag` instead of `TypeTag` as the key here, although there might be a good reason that you want the generic types."},"comment":{"url":"https://api.github.com/repos/sbt/util/issues/comments/366160053","html_url":"https://github.com/sbt/util/issues/151#issuecomment-366160053","issue_url":"https://api.github.com/repos/sbt/util/issues/151","id":366160053,"user":{"login":"retronym","id":65551,"avatar_url":"https://avatars0.githubusercontent.com/u/65551?v=4","gravatar_id":"","url":"https://api.github.com/users/retronym","html_url":"https://github.com/retronym","followers_url":"https://api.github.com/users/retronym/followers","following_url":"https://api.github.com/users/retronym/following{/other_user}","gists_url":"https://api.github.com/users/retronym/gists{/gist_id}","starred_url":"https://api.github.com/users/retronym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retronym/subscriptions","organizations_url":"https://api.github.com/users/retronym/orgs","repos_url":"https://api.github.com/users/retronym/repos","events_url":"https://api.github.com/users/retronym/events{/privacy}","received_events_url":"https://api.github.com/users/retronym/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T07:09:14Z","updated_at":"2018-02-16T07:09:14Z","author_association":"OWNER","body":"The performance problem might be related to an issue with Scala runtime reflection. I wouldn't be surprised we've got some sort of quadratic performance problem wrt number of members in a package object, ala ```sbt.`package` ```"}}
{"actor":{"display_login":"retronym"}}