In the webapp atomics, processing of POST commands has about a 10% regression in GF 3.x vs 4.0. The attached screen shots show the difference.
The time spent in the actual character encoding is similar between the two tests (5K calls per test), but all the buffer manipulation time has impacted the parameter handling.
I tried implementing the processParameters method to do it in a single shot on the character array (since that methods already exists, it was quite easy...). So essentially:
byte b = ((org.glassfish.grizzly.memory.HeapBuffer) buffer).array();
char c = new char[len];
for (int i = start, pos = 0; pos < len; i++)
processParameters(c, 0, len);
Except that we would really need to call the encoder, but since my locale is 8-bit this was find for a quick test. That significantly improved the performance of the POST testing; GF 4 now comes in 10% faster that GF 3.1.2 (so even introducing the encoder will be fine at that point). And the requires that array() be a public method on HeapBuffer (as it is on the NIO class in the first place...) or some other mechanism. Still, then the point is is need take the setup/teardown overhead of the buffer structure only once instead of on every parameter as we do now.