equal-l2 / Hack-tools

Assembler for Hack Assembly, and translator for Hack VM language
0 stars 0 forks source link

[Assembler] Performance issue #1

Closed equal-l2 closed 7 years ago

equal-l2 commented 7 years ago

Assembler is quite slow if input file is large.

For example, if Pong.asm (from nand2tetris), which has about 28000 lines, is used as input, assembling take about 3 minutes.

This problem may depend on STL implementation. If Assembler is compiled on GCC, assembling Pong.asm takes about 3 minutes. However, if compiled on cl.exe by Microsoft, assembling takes less than 5 seconds. Both times are measured in maximum optimization ( -O3 or /Ox)

equal-l2 commented 7 years ago

This problem has been solved by making regex objects static.