What IDE are you using to make these tests? For the Galileo Gen 2, you can use the Arduino IDE to get speeds higher than 621Hz.
Take a look at EmutexLabs
Section 3.2 has sketches and specific information about functions that can reach higher speeds.
“Informal performance testing using the sketch examples above suggests the following performance capability:
fastGpioDigitalWrite 660-680 kHz (varies depending on which digital pin is used)
fastGpioDigitalRegWriteUnsafe 1.2-2.9 MHz (varies depending on which digital pin is used)”
I am NOT using an IDE.
Just vi to create my java file, i do compile on the galileo.
I rely on that java library:
But it does not contai,n FastGPIO access
My mail show very pour java execution perfermonce ( even WITHOUT calling digital read).
The fastgpio feature is available on the Arduino IDE and you can use it to get the speed I listed above, if you are not planning on using the Arduino IDE, then you will have to modify the library from [Library] GPIO library for Java (Galileo Debian v1.2 image) and add the fastgpio function.
You can take a look at the Arduino code to see how Arduino IDE handles the fastgpio function and use it as a template to write your own library.