|
Oktatás * Programozás 1 * Szkriptnyelvek Teaching * Programming 1 (BI) Félévek Linkek * kalendárium |
Nim2 /
Run a program without explicitly compiling itThe command "
However, as I noticed, it executes the cached EXE quite slowly. It takes about 100 msec on my PC. Example: $ nim r prg.nim Hint: used config file '/home/jabba/.choosenim/toolchains/nim-2.2.8/config/nim.cfg' [Conf] Hint: used config file '/home/jabba/.choosenim/toolchains/nim-2.2.8/config/config.nims' [Conf] .......................................................................................... /tmp/send/prg.nim(4, 8) Warning: imported and not used: 'strutils' [UnusedImport] /tmp/send/prg.nim(5, 8) Warning: imported and not used: 'strformat' [UnusedImport] /tmp/send/prg.nim(6, 8) Warning: imported and not used: 'sequtils' [UnusedImport] CC: system/exceptions.nim CC: std/private/digitsutils.nim CC: system/dollars.nim CC: system.nim CC: prg.nim Hint: [Link] Hint: mm: orc; threads: on; opt: none (DEBUG BUILD, `-d:release` generates faster code) 45286 lines; 0.674s; 59.059MiB peakmem; proj: /tmp/send/prg.nim; out: /home/jabba/.cache/nim/prg_d/prg_2E35874E36BC0A3365C1006F19810C4C4978E67C [SuccessX] Hint: /home/jabba/.cache/nim/prg_d/prg_2E35874E36BC0A3365C1006F19810C4C4978E67C [Exec] hello $ nim r prg.nim Hint: used config file '/home/jabba/.choosenim/toolchains/nim-2.2.8/config/nim.cfg' [Conf] Hint: used config file '/home/jabba/.choosenim/toolchains/nim-2.2.8/config/config.nims' [Conf] Hint: mm: orc; threads: on; opt: none (DEBUG BUILD, `-d:release` generates faster code) 10787 lines; 0.020s; 10.555MiB peakmem; proj: /tmp/send/prg.nim; out: /home/jabba/.cache/nim/prg_d/prg_2E35874E36BC0A3365C1006F19810C4C4978E67C [SuccessX] Hint: /home/jabba/.cache/nim/prg_d/prg_2E35874E36BC0A3365C1006F19810C4C4978E67C [Exec] hello Here, "hello" is the output of the simple program. When " You can also suppress the info lines: $ time nim r --hints:off --warnings:off prg.nim hello (534 msec) $ time nim r --hints:off --warnings:off prg.nim hello (100 msec) As I mentioned earlier, the cached EXE is executed quite slowly. That 100 msec is a lot. Let's compile the program and check how fast the EXE starts: $ nim c prg.nim $ time ./prg hello (2.33 msec) That's 43x faster. I have a solution for this problem, see here. |
![]() Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |