@@ -11,7 +11,6 @@ import (
1111 "github.com/conductorone/baton-sdk/pkg/connectorstore"
1212 "github.com/conductorone/baton-sdk/pkg/dotc1z"
1313 "github.com/conductorone/baton-sdk/pkg/synccompactor/attached"
14- "github.com/conductorone/baton-sdk/pkg/synccompactor/naive"
1514 "github.com/stretchr/testify/require"
1615)
1716
@@ -209,66 +208,6 @@ func generateTestData(ctx context.Context, t *testing.B, tmpDir string, dataset
209208 return baseFile , baseSyncID , appliedFile , appliedSyncID
210209}
211210
212- // benchmarkNaiveCompactor runs a benchmark using the naive compactor.
213- func benchmarkNaiveCompactor (b * testing.B , dataset BenchmarkData ) {
214- ctx := context .Background ()
215-
216- for b .Loop () {
217- b .StopTimer ()
218-
219- // Create temporary directories
220- tmpDir , err := os .MkdirTemp ("" , "benchmark-naive" )
221- require .NoError (b , err )
222- defer os .RemoveAll (tmpDir )
223-
224- outputDir , err := os .MkdirTemp ("" , "benchmark-output" )
225- require .NoError (b , err )
226- defer os .RemoveAll (outputDir )
227-
228- // Generate test data
229- baseFile , _ , appliedFile , _ := generateTestData (ctx , b , tmpDir , dataset )
230-
231- opts := []dotc1z.C1ZOption {
232- dotc1z .WithPragma ("journal_mode" , "WAL" ),
233- }
234-
235- // Use naive compactor
236- baseC1Z , err := dotc1z .NewC1ZFile (ctx , baseFile , opts ... )
237- require .NoError (b , err )
238- defer baseC1Z .Close ()
239-
240- appliedC1Z , err := dotc1z .NewC1ZFile (ctx , appliedFile , opts ... )
241- require .NoError (b , err )
242- defer appliedC1Z .Close ()
243-
244- destFile := filepath .Join (tmpDir , "naive-dest.c1z" )
245- destOpts := []dotc1z.C1ZOption {
246- dotc1z .WithTmpDir (tmpDir ),
247- }
248- destOpts = append (destOpts , opts ... )
249- destC1Z , err := dotc1z .NewC1ZFile (ctx , destFile , destOpts ... )
250- require .NoError (b , err )
251- defer destC1Z .Close ()
252-
253- // Start a sync in the destination file
254- _ , err = destC1Z .StartNewSync (ctx , connectorstore .SyncTypeFull , "" )
255- require .NoError (b , err )
256-
257- b .StartTimer ()
258-
259- // Benchmark the naive compaction
260- naiveCompactor := naive .NewNaiveCompactor (baseC1Z , appliedC1Z , destC1Z )
261- err = naiveCompactor .Compact (ctx )
262- require .NoError (b , err )
263-
264- b .StopTimer ()
265-
266- // End the sync
267- err = destC1Z .EndSync (ctx )
268- require .NoError (b , err )
269- }
270- }
271-
272211// benchmarkAttachedCompactor runs a benchmark using the attached compactor.
273212func benchmarkAttachedCompactor (b * testing.B , dataset BenchmarkData ) {
274213 ctx := context .Background ()
@@ -328,26 +267,14 @@ func benchmarkAttachedCompactor(b *testing.B, dataset BenchmarkData) {
328267
329268// Benchmark functions for different data sizes and approaches
330269
331- func BenchmarkNaiveCompactor_Small (b * testing.B ) {
332- benchmarkNaiveCompactor (b , SmallDataset )
333- }
334-
335270func BenchmarkAttachedCompactor_Small (b * testing.B ) {
336271 benchmarkAttachedCompactor (b , SmallDataset )
337272}
338273
339- func BenchmarkNaiveCompactor_Medium (b * testing.B ) {
340- benchmarkNaiveCompactor (b , MediumDataset )
341- }
342-
343274func BenchmarkAttachedCompactor_Medium (b * testing.B ) {
344275 benchmarkAttachedCompactor (b , MediumDataset )
345276}
346277
347- func BenchmarkNaiveCompactor_Large (b * testing.B ) {
348- benchmarkNaiveCompactor (b , LargeDataset )
349- }
350-
351278func BenchmarkAttachedCompactor_Large (b * testing.B ) {
352279 benchmarkAttachedCompactor (b , LargeDataset )
353280}
0 commit comments