Skip to content
This repository has been archived by the owner on Dec 10, 2022. It is now read-only.

Relooper.2018 #291

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

Relooper.2018 #291

wants to merge 61 commits into from

Conversation

soywiz
Copy link
Member

@soywiz soywiz commented Jan 15, 2018

Fixes #78

Yeah. Finally! :) It doesn't work properly yet, but it is almost working.

The process consists in:

  • Separate the graph in Strong Components
  • Each strong component represents a loop
  • Each strong component should have a single entry and a single exit (modulo breaking/continuing other loops) in a reductible graph
  • That entry/exit delimits the loop
  • Inside strong components, all links should be internal, or external referencing the beginning/end of this or other loops.
  • Internal links to that component represents ifs, while external links represents, break or continue to specific loops
  • Each loop/strong component should be splitted into smaller strong components after removing links to the beginning of the loop to detect inner loops

@soywiz
Copy link
Member Author

soywiz commented Jan 16, 2018

Current results, still some work remaining and some functions not relooped (JS) and the code currently uses labels for all loops which won't be required for most of them once finished so the output size will be smaller.

OLD:

File size: 643K

JTransc 0.6.8 - js
Java 1.8.0_51 - 25.51-b03 - 1.8.0_51-b16
freeMemory: 0, maxMemory: 8589934592, totalMemory: 8589934592
Benchmarking:
plain loops...13.0
shift left constant...13.0
shift right constant...16.0
shift unsigned right constant...15.0
shift left constant long...155.0
shift right constant long...144.0
shift unsigned right constant long...141.0
left shift...20.0
right shift...20.0
right unsigned shift...20.0
call static mult...18.0
call instance mult...22.0
call instance div...81.0
instanceof classes...106.0
arraycopy int...9.0
write byte[]...20.0
write short[]...30.0
write char[]...20.0
write int[]...20.0
write float[]...22.0
write double[]...21.0
String Builder 1...161.0
String Builder 2...40.0
long arithmetic...133.0
simd mutable...59.0
simd immutable...103.0
simd mutable matrix mult...199.0
StringBuilder1...59.0
StringBuilder2...61.0
Non Direct Buffer...3.0
Direct Buffer Int/float...3.0
Direct Buffer Short/Char...3.0
Direct Buffer Double/Long...10.0
FastMemory...2.0
Create Instances1 local...8.0
Create Instances2 local...7.0
Create Instances2 global...67.0
Create Instances with builder...94.0
Java's CRC32...104.0
jzlib's CRC32...113.0
compress java's Deflate...62.0
compress jzlib...63.0
random...53.0
exception...69.0
TOTAL time: 2402.0

NEW:

File size: 599K

JTransc 0.6.9-SNAPSHOT - js
Java 1.8.0_51 - 25.51-b03 - 1.8.0_51-b16
freeMemory: 0, maxMemory: 8589934592, totalMemory: 8589934592
Benchmarking:
plain loops...5.0
shift left constant...5.0
shift right constant...5.0
shift unsigned right constant...5.0
shift left constant long...150.0
shift right constant long...149.0
shift unsigned right constant long...177.0
left shift...13.0
right shift...13.0
right unsigned shift...17.0
call static mult...13.0
call instance mult...12.0
call instance div...77.0
instanceof classes...58.0
arraycopy int...13.0
write byte[]...8.0
write short[]...8.0
write char[]...8.0
write int[]...8.0
write float[]...10.0
write double[]...10.0
String Builder 1...133.0
String Builder 2...22.0
long arithmetic...114.0
simd mutable...48.0
simd immutable...82.0
simd mutable matrix mult...189.0
StringBuilder1...60.0
StringBuilder2...58.0
Non Direct Buffer...1.0
Direct Buffer Int/float...1.0
Direct Buffer Short/Char...0.0
Direct Buffer Double/Long...9.0
FastMemory...1.0
Create Instances1 local...9.0
Create Instances2 local...7.0
Create Instances2 global...75.0
Create Instances with builder...95.0
Java's CRC32...57.0
jzlib's CRC32...52.0
compress java's Deflate...57.0
compress jzlib...58.0
random...58.0
exception...68.0
TOTAL time: 2018.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant