nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.48k stars 1.47k forks source link

gc:arc: lib\pure\os.nim Hint [Performance] #16314

Closed SFR0815 closed 3 years ago

SFR0815 commented 3 years ago

While compiling (on windows) with --gc:arc performance related hints are generated by the compiler

Example

ding.nim:

import os
discard os.paramStr(0)
discard os.parseCmdLine("ding")

nim c --gc:arc ding.nim

Current Output

The following hints apprear on the console:

...\.choosenim\toolchains\nim-1.4.2\lib\pure\os.nim(2764, 64) Hint: passing 'ownArgv[i]' to a sink parameter introduces an implicit copy; if possible, rearrange your program's control flow to prevent it [Performance]
...\.choosenim\toolchains\nim-1.4.2\lib\pure\os.nim(2669, 17) Hint: passing 'a' to a sink parameter introduces an implicit copy; if possible, rearrange your program's control flow to prevent it [Performance]

Expected Output

nothing

timotheecour commented 3 years ago

not windows specific

ringabout commented 3 years ago

There are no warnings on devel.