| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Thank you for the PR! I see one problem with the current approach. If someone has a machine that doesn't support 512-bit vectors, they cannot test the implementation for this width. Java provides scalar replacements when hardware support for a specific width is missing. Therefore, it should be possible to test 512-bit vectors on 256-bit-capable machines. I did a brief research, but I couldn't find any JVM flag that would override SPECIES_PREFERRED. The only idea that comes to mind, which would allow testing all vector widths on any platform, is to introduce a parameter at the library level and use it to determine the SPECIES used by the parser. Given that we currently resolve SPECIES in a static block in the StructuralIndexer, it might be sufficient to pass the parameter as a system property (System.getProperty) and only overwrite the preferred width if the parameter is set. What are your thoughts on this? |
Sorry, something went wrong.
|
Thank you for the comments. What you suggested is better. I updated the static initializer in StructuralIndexer.java to use a system property. Now the tests are run unconditionally with both vector widths. I tested this on my 512-bit-enabled platform. At the moment I don't have access to a 256-only platform so, to trigger the scalar use case, I temporarily combined -XX:UseAvx=2 and -Dorg.simdjson.species=512. The tests took about twice as long to run but ran successfully. |
Sorry, something went wrong.
|
It looks good to me. Thank you again. |
Sorry, something went wrong.
* test both vector species if on 512-bit-capable platform * test both species on all platforms
| Back | FazBrowse Home | New Git URL |
Addresses issue #23: Test all supported vector widths.
Changes build.gradle and adds a gradle.properties file. Now tests with both 256-bit and 512-bit vectors on 512-bit-capable platforms. Tests only with 256-bit vectors on 256-bit-capable platforms.