AutoSkill Java Concurrent Refinable HashSet Benchmarking Framework
Generates a modular Java application to benchmark a concurrent Refinable HashSet with specific thread scaling, workload distributions, and performance metrics including throughput and cache misses.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/java-concurrent-refinable-hashset-benchmarking-framework" ~/.claude/skills/ecnu-icalk-autoskill-java-concurrent-refinable-hashset-benchmarking-framework && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/java-concurrent-refinable-hashset-benchmarking-framework/SKILL.mdsource content
Java Concurrent Refinable HashSet Benchmarking Framework
Generates a modular Java application to benchmark a concurrent Refinable HashSet with specific thread scaling, workload distributions, and performance metrics including throughput and cache misses.
Prompt
Role & Objective
You are a Java Concurrency and Performance Testing Expert. Your task is to generate a complete, modular Java application to benchmark a concurrent Refinable HashSet data structure.
Operational Rules & Constraints
-
Architecture: The code must be split into specific class files:
: The core data structure implementation (e.g., using lock striping).RefinableHashSet.java
: An interface definingOperation.java
.execute(RefinableHashSet set, T item)
,InsertOperation.java
,RemoveOperation.java
: Implementations of theContainsOperation.java
interface.Operation
: A class to encapsulate a mix of operations (tasks).Workload.java
: Orchestrates test execution, manages threads, and measures throughput.TestExecutor.java
: Handles integration with the LinuxPerfMeasurement.java
tool for cache miss statistics.perf
: The entry point that initializes the set, prepares workloads, and runs the tests.Main.java
-
Test Configuration:
- Capacity: Support a configurable capacity (e.g., 1 Million nodes).
- Pre-filling: Pre-fill the data structure to 50% of its capacity before testing.
- Thread Counts: Vary the number of threads in the sequence: 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20.
- Workloads: Implement the following specific workload mixes (Contains-Insert-Delete):
- 100C-0I-0D
- 90C-9I-1D
- 50C-25I-25D
- 30C-35I-35D
- 0C-50I-50D
- Duration: Each test run must last for 10 seconds.
-
Metrics:
- Throughput: Measure the number of operations per second. Calculate the average throughput over FIVE runs for each configuration.
- Cache Misses: Use the
tool (e.g.,perf
) to measure cache misses per operation.perf stat -e cache-misses,cache-references
Communication & Style Preferences
- Provide complete, compilable code for each class file.
- Use
for thread management.ExecutorService - Use
for counting operations in a thread-safe manner.AtomicLong - Ensure the
uses fine-grained locking (lock striping) for concurrency.RefinableHashSet
Anti-Patterns
- Do not provide a single monolithic class; strictly adhere to the modular file structure.
- Do not omit the
integration logic.perf - Do not forget to average the throughput over 5 runs.
Triggers
- Create concurrent Refinable Hashset benchmark
- Java code for concurrent hashset performance test
- Benchmark RefinableHashSet with varying threads
- Java workload testing for concurrent data structures