Skip to content

Replace use of sort package with modern alternatives - #9013

Merged
sspaink merged 1 commit into
open-policy-agent:mainfrom
anderseknert:modernize-sorting
Aug 13, 2026
Merged

Replace use of sort package with modern alternatives#9013
sspaink merged 1 commit into
open-policy-agent:mainfrom
anderseknert:modernize-sorting

Conversation

@anderseknert

Copy link
Copy Markdown
Member

And a couple of other improvements to make use of more recent functions from the slices, maps and our own util packages.

Added the forbidigo linter to make sure we're told about this should we forget it later.

And a couple of other improvements to make use of more
recent functions from the `slices`, `maps` and our own
`util` packages.

Added the forbidigo linter to make sure we're told about
this should we forget it later.

Signed-off-by: Anders Eknert <anders.eknert@apple.com>
@sspaink
sspaink merged commit e7c18bb into open-policy-agent:main Aug 13, 2026
44 checks passed
@anderseknert
anderseknert deleted the modernize-sorting branch August 13, 2026 17:09
@github-actions

Copy link
Copy Markdown
Benchmark Comparison (`88a03034abf2b267aae4d1b5d6690d03f814fa6d` vs `e7c18bbc721841a54fbf67613c48f6423aed05dc`)
benchmark delta
StoreRead +12.92%
AggregatedLabels/on -2.60%
WASMColdStartTargets/wasm -5.63%
benchmark delta
ComprehensionBindings/ObjectComp_2Vars +0.95%
ComprehensionBindings/ObjectComp_3Vars +1.15%
ComprehensionOptimizationComparison/SimpleSetComp +1.23%
JSONPatchAddShallowScalar/object-100 +1.41%
JSONPatchAddShallowScalar/object-1000 +1.17%
JSONPatchAddShallowScalar/array-100 +1.10%
JSONPatchAddShallowComposite/array-10000-100 -1.60%
JSONPatchAddRemove/object-10-1000 +1.41%
JSONPatchAddRemove/object-100-10000 +3.03%
JSONPatchAddRemove/object-1000-1000 +3.09%
JSONPatchAddRemove/array-10-10 +3.40%
JSONPatchAddRemove/array-10-100 +0.92%
JSONPatchAddRemove/array-10-1000 +3.50%
JSONPatchAddRemove/array-10-10000 +4.00%
JSONPatchAddRemove/array-100-1000 +1.44%
JSONPatchAddRemove/array-1000-1000 +1.76%
JSONPatchAddRemove/set-10-100 +1.93%
JSONPatchAddRemove/set-10-10000 +2.13%
JSONPatchAddRemove/set-100-10000 +2.55%
JSONPatchAddRemove/set-10000-100 -2.96%
JSONPatchReplace/10x10x10-10p -2.40%
JSONPatchReplace/10x10x10-100p -0.93%
JSONPatchReplace/100x10x10-1000p -0.80%
JSONPatchReplace/1000x1000x10-10p +1.39%
NumbersRange/interned -3.76%
NumbersRangeStep/not_interned -2.07%
ObjectUnionN/10x10 -2.83%
ObjectUnionN/10x100 -2.51%
ObjectUnionN/100x10 -2.52%
ObjectUnionN/100x100 -2.43%
ObjectUnionNSlow/250x10 -1.31%
ObjectUnionNCallOnly/single_object +3.20%
ObjectUnionNCallOnly/merge_empty -2.13%
ObjectUnionNCallOnly/merge_non-overlapping -1.97%
ObjectUnionNCallOnly/merge_overlapping -1.82%
ObjectUnionNCallOnly/merge_nested -2.46%
ObjectUnionNCallOnly/merge_nested_with_conflict -1.40%
ObjectUnionNCallOnly/merge_nested_no_equal_branch -2.07%
SetUnionSlow/100x250 -2.35%
SetUnionSlow/250x100 -2.41%
SetUnionSlow/250x250 -3.59%
TrimSpace/trimmable +10.92%
TrimSpace/not_trimmable +4.68%
TemplateStringVsConcatVsSprintfLocal/sprinted -1.18%
InliningFullScan/300000 -2.36%
benchmark delta
BuildNonsensicalIndex/10 -4.12%
ParseModuleRulesBase/10 -2.94%
ParseStatementMixedJSON -3.56%
ParseStatementSimpleArray/10 -1.37%
ParseStatementSimpleArray/100 -2.63%
ParseStatementSimpleArray/1000 -2.32%
ParseStatementNestedObjects/1x5 -1.23%
ParseStatementNestedObjects/1x10 -2.42%
ParseStatementNestedObjects/5x5 -2.84%
ParseEvery -1.17%
ParseDeepNesting/NestedArrays/depth-50 -3.24%
ParseDeepNesting/NestedObjects/depth-50 -3.55%
ParseDeepNesting/NestedObjects/depth-100 -3.96%
ParseDeepNesting/NestedObjects/depth-500 -4.24%
ExprString/negated_expr_with_with_modifier -1.41%
ObjectGet/lookup_in_empty_object -22.20%
ObjectCreateWithInsertVsTermsArray/insert -2.63%
ObjectCreateWithInsertVsTermsArray/terms_array -2.54%
LazyObjectFind/5000_50 +0.44%
ObjectString/5000/json.Marshal -1.32%
EscapeTemplateStringStringPart/_*_100 +5.99%
CountUnescapedLeftCurly/_*_100 +5.12%
InterningAccessValue/object_value +6.60%
FromBuiltinNames/single_part -1.71%
NoNodeTypeAllocatesOnAppend/some_in_decl -2.15%
NoASTTypeAllocatesOnAppendToBufferOfStringLength/var -2.91%
NoASTTypeAllocatesOnAppendToBufferOfStringLength/string +1.60%
NoASTTypeAllocatesOnAppendToBufferOfStringLength/number +9.82%
NoASTTypeAllocatesOnAppendToBufferOfStringLength/object_comprehension_infix_value +2.61%
NoASTTypeAllocatesOnAppendToBufferOfStringLength/array_comprehension +2.46%
NoASTTypeAllocatesOnAppendToBufferOfStringLength/array_comprehension_nested_infix_operators +3.63%
NoASTTypeAllocatesOnAppendToBufferOfStringLength/array_comprehension_non-infix_head +4.65%
NoASTTypeAllocatesOnAppendToBufferOfStringLength/array_comprehension_nested_infix_with_function_call +4.16%

This comment was automatically generated by the benchmarks workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants