chaokunyang commented on code in PR #1778: URL: https://github.com/apache/fury/pull/1778#discussion_r1696247553
########## rust/fury/benches/simd_utf16_to_utf8.rs: ########## @@ -0,0 +1,100 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#[cfg(target_arch = "aarch64")] +use std::arch::is_aarch64_feature_detected; +use std::{env, fs}; + +use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use fury::{utf16_to_utf8, utf16_to_utf8_simd}; + +#[cfg(target_endian = "big")] +const IS_LITTLE_ENDIAN_LOCAL: bool = false; + +#[cfg(target_endian = "little")] +const IS_LITTLE_ENDIAN_LOCAL: bool = true; + +fn criterion_benchmark(c: &mut Criterion) { + let current_dir = env::current_dir() + .expect("Failed to get current directory") + .join("benches"); + let path1 = current_dir.join("chinese.utf8.txt"); Review Comment: Seems it's only used here, could we use a smaller test data? I think two or three string line of literal is enough for benchmark -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
