go-jsonnet/testdata/equals4.jsonnet
Stanisław Barzowski 530cf7b07c Implement operators == and != as builtins (#221)
People use these operators in tight loops, without even
thinking about it, and it's previous implementation required
multiple object lookups (std.), string comparisons (for types)
and multiple jsonnet function calls.

This change introduces builtin, efficient implementation.
It results in ~3x speedup in strContains benchmark that
Angus provided on Slack.

Additional benefit is that equals/primitiveEquals distinction
is now obsolete, which made things simpler for everyone.
2018-05-23 22:26:30 -04:00

1 line
34 B
Jsonnet

{x: 1, y: 1} == {x: 1, y: 1, z: 2}