class EL_BENCHMARK_COMPARISON

(source code)

Client examples: ARRAYED_VS_HASH_SET_SEARCHARRAYED_VS_LINKED_LISTATTACH_TEST_VS_BOOLEAN_COMPARISONBIT_POP_COUNT_COMPARISONBIT_SHIFT_COUNT_COMPARISONCLASS_ID_ENUM_VS_TYPE_OBJECTCOMPACTABLE_REFLECTIVE_VS_MANUAL_BIT_MASKDEVELOPER_COMPARISONDIRECTORY_WALK_VS_FIND_COMMANDHASH_TABLE_VS_NAMEABLES_LIST_SEARCHLIST_ITERATION_COMPARISONP_I_TH_LOWER_UPPER_VS_INLINE_CODEREFLECTED_REFERENCE_VS_OPTIMIZED_FIELD_RWROUTINE_CALL_ON_ONCE_VS_EXPANDEDSTRING_8_SPLIT_VS_SPLIT_ON_CHARACTER_8STRING_BENCHMARK_COMPARISONSYSTEM_TIME_COMPARISONTOKENIZED_STEPS_VS_XPATH_STRING

description

Benchmark comparison

note
	description: "Benchmark comparison"

	author: "Finnian Reilly"
	copyright: "Copyright (c) 2001-2022 Finnian Reilly"
	contact: "finnian at eiffel hyphen loop dot com"

	license: "MIT license (See: en.wikipedia.org/wiki/MIT_License)"
	date: "2023-08-08 8:52:53 GMT (Tuesday 8th August 2023)"
	revision: "14"

deferred class
	EL_BENCHMARK_COMPARISON

inherit
	EL_COMMAND

	EL_MODULE_LIO

	EL_MODULE_EXECUTABLE

feature {EL_FACTORY_CLIENT} -- Initialization

	make (a_trial_duration: INTEGER_REF)
		do
			trial_duration := a_trial_duration
			initialize
		end

feature -- Access

	description: READABLE_STRING_GENERAL
		deferred
		end

feature -- Basic operations

	execute
		deferred
		end

feature {NONE} -- Implementation

	compare (label: READABLE_STRING_GENERAL; routines: ARRAY [TUPLE [READABLE_STRING_GENERAL, ROUTINE]])
		local
			table: EL_BENCHMARK_ROUTINE_TABLE
		do
			create table.make (label, routines)
			if trial_duration.item.to_boolean then
				table.set_trial_duration (trial_duration.item)
			end
			lio.put_new_line
			lio.put_labeled_string ("Class", generator)
			lio.put_new_line_x2
			lio.put_labeled_string ("BENCHMARKING", table.label)
			lio.put_new_line_x2

			table.perform
			table.print_comparison
			lio.put_new_line
		end

	initialize
		do
			do_nothing
		end

feature {NONE} -- Internal attributes

	trial_duration: INTEGER_REF

end