A couple fixes for Ivy JIT#24565
Conversation
inject() was changed in da31db7 to not take a default value parameter, so injectable_compiler_2 should not request the use of one when using inject().
|
You can preview 744db24 at https://pr24565-744db24.ngbuilds.io/. |
There was a problem hiding this comment.
Should this be a standard for loop or doesn't matter?
There was a problem hiding this comment.
It could be. I've been taking an approach where I use ES6/fluent code unless something is provably a performance bottleneck.
There was a problem hiding this comment.
I'm with @alfaproject on this, may as well write a for loop. One less function allocation per call to this function.
There was a problem hiding this comment.
I find the fluent form much more readable, and it's used throughout the compiler today. I would rather not optimize prematurely. If benchmarks show that these temporary allocations (which are short lived anyway) cause significant performance issues, then we should optimize it. Until then, my goal is to keep the code as readable as possible.
There was a problem hiding this comment.
I meant:
for (const value of values) {
const [field, property] = value.split(',').map(piece => piece.trim());
map[field] = property || field;
}which is just as readable (I think) with the benefit of being more performant.
benlesh
left a comment
There was a problem hiding this comment.
A few small things, overall looks good.
There was a problem hiding this comment.
You might considier making this into a pure function that reduces into the map. It can be used to create the map above.
There was a problem hiding this comment.
remove the map() here, and do the trim() on the next line where you need to. One less Array allocation.
There was a problem hiding this comment.
As we discussed, I'm not worried about optimizing the allocations at the moment.
There was a problem hiding this comment.
I'm with @alfaproject on this, may as well write a for loop. One less function allocation per call to this function.
There was a problem hiding this comment.
I know you didn't touch this, but is the omission of a hasOwnProperty check here intentional?
There was a problem hiding this comment.
And as below, this could be a for..of loop, that will save a function allocation per turn through this loop.
There was a problem hiding this comment.
The same questions/problems exist in other code below (that you didn't touch) in extractHostBindings
There was a problem hiding this comment.
I know you didn't touch this, but is the omission of a hasOwnProperty check here intentional.
Can you elaborate on what the hasOwnProperty check would check? I don't follow.
Most comments addressed, please re-review.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
inputsandoutputsfrom metadata.inject()in code generation.