-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
move eqIdent to vm.nim #7585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move eqIdent to vm.nim #7585
Conversation
|
well I did this for performance optimizatioon and now the build fails because build time exceeds the maximum allowed time. Well the question is, was this my fault, or was there heave work load on the server and the built failed because of that? |
| decodeBC(rkInt) | ||
| if regs[rb].node.kind == nkIdent and regs[rc].node.kind == nkIdent: | ||
| regs[ra].intVal = ord(regs[rb].node.ident.id == regs[rc].node.ident.id) | ||
| # aliases for shorter and easier to understand code below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not bad, but since rawExecute is already really long (!), it should be extracted into a helper proc.
lib/core/macros.nim
Outdated
| ## Style insensitive comparison. | ||
|
|
||
| proc eqIdent*(a: NimNode; b: string): bool {.magic: "EqIdent", noSideEffect.} | ||
| ## Style insesitive comparison. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here.
lib/core/macros.nim
Outdated
| ## ``a`` can be an identifier or a symbol. | ||
|
|
||
| proc eqIdent*(a: string; b: NimNode): bool {.magic: "EqIdent", noSideEffect.} | ||
| ## Style insesitive comparison. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
lib/core/macros.nim
Outdated
| ## ``b`` can be an identifier or a symbol. | ||
|
|
||
| proc eqIdent*(a: NimNode; b: NimNode): bool {.magic: "EqIdent", noSideEffect.} | ||
| ## Style insesitive comparison. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
This actually adds a test for identifier equality. Then it almost removes one instance of the many duplicates of
cmpIgnoreStyle. Really copy pasting that function everywhere and then ensuring that the only central version in strutils.nim remains broken doesn't help at all.The main motivation for this change is that
eqIdentis called at lot in macros. I will also generate a lot of it form the ast pattern matching library that I am currently working on. I just wanted it to be fast.