tokiwa-software / fuzion

The Fuzion Language Implementation
https://fuzion-lang.dev
GNU General Public License v3.0
47 stars 11 forks source link

webserver.fz: DFA is very slow #4028

Open maxteufel opened 1 week ago

maxteufel commented 1 week ago

With tokiwa-software/fzweb#5, compiling the webserver seems to be stuck during the DFA phase:

$ make run_fz 
~/src/fuzion/build/bin/fz -verbose=2 -unsafeIntrinsics=on -modules=lock_free,java.base,java.desktop,java.datatransfer,java.xml,java.logging,java.security.sasl,webserver -sourceDirs=src run
2870 features 1453 types and 21 source files includes in fum file.
DFA iteration #1: --------------------------------------------------
DFA iteration #2: --------------------------------------------------
DFA iteration #3: --------------------------------------------------
DFA iteration #4: --------------------------------------------------
DFA iteration #5: --------------------------------------------------
DFA iteration #6: --------------------------------------------------
DFA iteration #7: --------------------------------------------------
DFA iteration #8: --------------------------------------------------
DFA iteration #9: --------------------------------------------------
DFA iteration #10: --------------------------------------------------
DFA iteration #11: --------------------------------------------------
DFA iteration #12: --------------------------------------------------
DFA iteration #13: --------------------------------------------------
DFA iteration #14: --------------------------------------------------
DFA iteration #15: --------------------------------------------------
DFA iteration #16: --------------------------------------------------
DFA iteration #17: --------------------------------------------------
DFA iteration #18: --------------------------------------------------
DFA iteration #19: --------------------------------------------------
DFA iteration #20: --------------------------------------------------
DFA iteration #21: --------------------------------------------------
DFA iteration #22: --------------------------------------------------
DFA iteration #23: --------------------------------------------------
DFA iteration #24: --------------------------------------------------
DFA iteration #25: --------------------------------------------------
DFA iteration #26: --------------------------------------------------
DFA iteration #27: --------------------------------------------------
DFA iteration #28: --------------------------------------------------
^Cmake: *** [Makefile:24: run_fz] Error 130

it just keeps going from there

maxteufel commented 1 week ago

This also seems to be happening without tokiwa-software/fzweb#5 and #3987. In that case, it ends:

Elapsed time for phases: prep 50ms, fe 1430ms, createMIR 307ms, ir 11ms, dfa 214953ms, be 1595ms

...which is way longer than before the DFA changes.

maxteufel commented 1 week ago

Original also terminates, it seems:

Elapsed time for phases: prep 51ms, fe 1341ms, createMIR 284ms, ir 9ms, dfa 198790ms, be 1757ms
michaellilltokiwa commented 1 week ago

@tokiwa-software/developers Perfect showcase that we need more examples with 1000+ lines of code.

fridis commented 15 hours ago

Here are some first insights that might help until this is solved:

I build the webserver with the -jar target have a simple benchmark, result measured on my machine using different configs:

Still very slow, working on it...