### Question:
ThriftSerializer { public <T extends TBase<T, ?>> T fromBytes(Class<T> clazz, byte[] data) throws ThriftSerializeException, IllegalArgumentException { Objects.requireNonNull(data, "data"); if (data.length > maxFrameSize) { throw new ThriftTooLongMessageException("Unable to read object " + clazz.getName() + ". It overrun size limit " + data.length); } Constructor<T> constructor = getConstructor(clazz); try { T object = constructor.newInstance(); TDeserializer deserializer = deserializerPool.borrowObject(); try { deserializer.deserialize(object, data); deserializerPool.returnObject(deserializer); return object; } catch (Exception ex) { try { deserializerPool.invalidateObject(deserializer); } catch (Exception ex2) { log.error("Unable to return object to pool", ex2); } throw ex; } } catch (TProtocolException e) { if (e.getType() == TProtocolException.SIZE_LIMIT) { throw new ThriftTooLongMessageException("Object contain too long field", e); } else { throw new ThriftSerializeException("Unable to deserialize " + clazz.getName(), e); } } catch (Exception e) { throw new ThriftSerializeException("Unable to deserialize " + clazz.getName(), e); } } ThriftSerializer();  ThriftSerializer(long maxFrameSize); static Constructor<T> getConstructor(Class<T> objectClass); T fromBytes(Class<T> clazz, byte[] data); byte[] toByte(T data); static final int DEFAULT_MAX_FRAME_SIZE; }### Answer:
@Test(groups = "unit") public void fromBytes() throws Exception { byte[] bytes = serializer.toByte(mapResult); for (int i = 0; i < 5000; i++) { serializer.fromBytes(MapResult.class, bytes); } ExecutorService executor = Executors.newFixedThreadPool(16); try { final int COUNT = 30_000; long start = System.nanoTime(); for (int i = 0; i < COUNT; i++) { long id = i; executor.execute(() -> serializer.fromBytes(MapResult.class, bytes)); } executor.shutdown(); if (!executor.awaitTermination(1, TimeUnit.MINUTES)){ fail("Unable to complete test"); } long time = System.nanoTime() - start; System.out.println("fromBytes Exec time (sec): " + (time / 1_000_000_000d)); System.out.println("fromBytes Rps: " + COUNT / (time / 1_000_000_000d)); } finally { executor.shutdown(); } }