These are chat archives for ThoughtWorksInc/Binding.scala

15th
Jun 2018
Leonid Turnaev
@glmars
Jun 15 2018 06:58

@Atry If you're interested, I have repeated the js-framework-benchmark with different versions of Binding.scala.
Here are results for: Chrome 32-bit and for: Chrome 64-bit (sorry, 3 runs only).

Conclusions and questions:

  • your conclusions about Scala 2.12 was confirmed, memory usage is increased by 22-23%:

glmars-v2.12-memory.png

  • but the absolute values are lower than in your results:

atry-v2.12-memory.png

  • I especially pleases by memory consumption on a 32-bit version of Chrome:

32-bit-memory.png

  • one question only: do you have any guesses why the clear rows time increased in Binding.scala v11.0.1?

clear-rows-increase.png

杨博 (Yang Bo)
@Atry
Jun 15 2018 07:10
v11 fixed a bug in v10 when removing a node. The fix to ThoughtWorksInc/Binding.scala#56 performs some internal cache invalidation.
Leonid Turnaev
@glmars
Jun 15 2018 07:21
Thank you, I also thought about this task :smile:
杨博 (Yang Bo)
@Atry
Jun 15 2018 07:23
There could be an optimization in Scala.js scala-js/scala-js#2675, which should improve both code size and computational performance.
The IIFE can be replaced to a normal code block, considering let and const in ECMAScript 2015 code blocks has the same lifecycle as var in IIFEs.
Leonid Turnaev
@glmars
Jun 15 2018 07:33
It will be great!
Thanks for the explanation.
杨博 (Yang Bo)
@Atry
Jun 15 2018 07:35
You can create a PR to Scala.js if you're interested to optimize the memory usage in Scala 2.12
When compling a closure to JavaScript
  • Scala.js 2.11 create classes
  • Scala.js 2.12 create nested closures in IIFEs, which consums more memory than classes
  • Ideally, it should create plain closures in code blocks (for ECMAScript 2015 target)
Leonid Turnaev
@glmars
Jun 15 2018 07:53
I understand an idea, but I'm not sure I am able to do this (because I don't know Scala.js insides very well) :worried:
杨博 (Yang Bo)
@Atry
Jun 15 2018 08:15
Never mind