Scala-js: Code size issue in 2.12.0-RC1: TraversableLike brings java.util.regex.*

Created on 13 Sep 2016  路  3Comments  路  Source: scala-js/scala-js

See https://github.com/scala-js/scala-js/pull/2590#issuecomment-246680527

Checksizes: Scala version: 2.12.0-RC1
Reversi preopt size = 594344 (expected 528000)
Reversi opt size = 148876 (expected 124000)
Reversi preopt gzip size = 77217 (expected 67000)
Reversi opt gzip size = 35696 (expected 30000)

Here is the culprit: https://github.com/scala/scala/commit/30876fe2dd8cbe657a6cad6b11bbc34f10c29b36
It introduces a call to String.split(Char), which transitively brings in the java.util.regex.* implementation. Since stringPrefix is called by MostCollection.toString(), this means that every single Scala.js codebase is paying the tax of java.util.regex.*.

bug upstream

Most helpful comment

Really glad there are at least the appropriate emoticons for this situation.

All 3 comments

Oh, and, in the same commit, the calls to Character.isDigit and isUpperCase bring in the Unicode database :scream:

Really glad there are at least the appropriate emoticons for this situation.

This is being addressed upstream: https://github.com/scala/scala/pull/5400

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lihaoyi picture lihaoyi  路  8Comments

dispalt picture dispalt  路  7Comments

laughedelic picture laughedelic  路  3Comments

japgolly picture japgolly  路  5Comments

sjrd picture sjrd  路  3Comments