// Path: iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/message/IEXMessage.java
// public abstract class IEXMessage implements Serializable {
// 
//     private final IEXMessageType messageType;
// 
//     public IEXMessage(final IEXMessageType messageType) {
//         this.messageType = messageType;
//     }
// 
//     public IEXMessageType getMessageType() {
//         return messageType;
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         final IEXMessage that = (IEXMessage) o;
//         return messageType == that.messageType;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(messageType);
//     }
// 
//     @Override
//     public String toString() {
//         return "IEXMessage{" +
//                 "messageType=" + messageType +
//                 '}';
//     }
// }
// 
// Path: iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/message/administrative/IEXSecurityDirectoryMessage.java
// public static IEXSecurityDirectoryMessage createIEXMessage(final byte[] bytes) {
//     final byte iexSecurityDirectoryFlag = bytes[1];
//     final long timestamp = IEXByteConverter.convertBytesToLong(Arrays.copyOfRange(bytes, 2, 10));
//     final String symbol = IEXByteConverter.convertBytesToString(Arrays.copyOfRange(bytes, 10, 18));
//     final int roundLotSize = IEXByteConverter.convertBytesToInt(Arrays.copyOfRange(bytes, 18, 22));
//     final IEXPrice adjustedPOCPrice = IEXByteConverter.convertBytesToIEXPrice(Arrays.copyOfRange(bytes, 22, 30));
//     final IEXLULDTier iexluldTier = IEXLULDTier.getLULDTier(bytes[30]);
// 
//     return new IEXSecurityDirectoryMessage(iexSecurityDirectoryFlag, timestamp, symbol, roundLotSize,
//             adjustedPOCPrice, iexluldTier);
// }


import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import pl.zankowski.iextrading4j.hist.api.message.IEXMessage;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import static pl.zankowski.iextrading4j.hist.api.message.administrative.IEXSecurityDirectoryMessage.createIEXMessage;
package pl.zankowski.iextrading4j.hist.perf;





public class LotsOfEnumsBenchmark extends PerformanceTestBase {

    @State(Scope.Benchmark)
    public static class BenchmarkState {

        public byte[] packet;

        @Setup(Level.Trial)
        public void doSetup() throws IOException {
            packet = loadPacket("LotsOfEnumsMessage.dump");
        }

    }

    @Benchmark
    @BenchmarkMode(Mode.AverageTime)
    @OutputTimeUnit(TimeUnit.MICROSECONDS)
    public IEXMessage lotsOfEnumsBenchmark(final LotsOfEnumsBenchmark.BenchmarkState benchmarkState) {
// Path: iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/message/IEXMessage.java
// public abstract class IEXMessage implements Serializable {
// 
//     private final IEXMessageType messageType;
// 
//     public IEXMessage(final IEXMessageType messageType) {
//         this.messageType = messageType;
//     }
// 
//     public IEXMessageType getMessageType() {
//         return messageType;
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         final IEXMessage that = (IEXMessage) o;
//         return messageType == that.messageType;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(messageType);
//     }
// 
//     @Override
//     public String toString() {
//         return "IEXMessage{" +
//                 "messageType=" + messageType +
//                 '}';
//     }
// }
// 
// Path: iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/message/administrative/IEXSecurityDirectoryMessage.java
// public static IEXSecurityDirectoryMessage createIEXMessage(final byte[] bytes) {
//     final byte iexSecurityDirectoryFlag = bytes[1];
//     final long timestamp = IEXByteConverter.convertBytesToLong(Arrays.copyOfRange(bytes, 2, 10));
//     final String symbol = IEXByteConverter.convertBytesToString(Arrays.copyOfRange(bytes, 10, 18));
//     final int roundLotSize = IEXByteConverter.convertBytesToInt(Arrays.copyOfRange(bytes, 18, 22));
//     final IEXPrice adjustedPOCPrice = IEXByteConverter.convertBytesToIEXPrice(Arrays.copyOfRange(bytes, 22, 30));
//     final IEXLULDTier iexluldTier = IEXLULDTier.getLULDTier(bytes[30]);
// 
//     return new IEXSecurityDirectoryMessage(iexSecurityDirectoryFlag, timestamp, symbol, roundLotSize,
//             adjustedPOCPrice, iexluldTier);
// }


// Path: iextrading4j-hist-performance/src/main/java/pl/zankowski/iextrading4j/hist/perf/LotsOfEnumsBenchmark.java
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import pl.zankowski.iextrading4j.hist.api.message.IEXMessage;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import static pl.zankowski.iextrading4j.hist.api.message.administrative.IEXSecurityDirectoryMessage.createIEXMessage;

package pl.zankowski.iextrading4j.hist.perf;





public class LotsOfEnumsBenchmark extends PerformanceTestBase {

    @State(Scope.Benchmark)
    public static class BenchmarkState {

        public byte[] packet;

        @Setup(Level.Trial)
        public void doSetup() throws IOException {
            packet = loadPacket("LotsOfEnumsMessage.dump");
        }

    }

    @Benchmark
    @BenchmarkMode(Mode.AverageTime)
    @OutputTimeUnit(TimeUnit.MICROSECONDS)
    public IEXMessage lotsOfEnumsBenchmark(final LotsOfEnumsBenchmark.BenchmarkState benchmarkState) {
        return createIEXMessage(benchmarkState.packet);