Compare commits
No commits in common. "1b7326eafe155f80c5e49fe4a8407c869a4d0ee9" and "a5b4eb40f60638959c782f5d7ee56b8baceb0138" have entirely different histories.
1b7326eafe
...
a5b4eb40f6
@ -4,23 +4,10 @@ set -euo pipefail
|
|||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
: ${PROFILE:="perf"}
|
|
||||||
|
|
||||||
function main {
|
|
||||||
local additional_flags=()
|
|
||||||
if [ "$PROFILE" = "dev" ] || [ "$PROFILE" = "debug" ]; then
|
|
||||||
PROFILE="debug"
|
|
||||||
else
|
|
||||||
additional_flags+=(--profile "$PROFILE")
|
|
||||||
# We have to disable avx512 because valgrind does not yet support it.
|
|
||||||
export RUSTFLAGS="-C target-feature=-avx512"
|
|
||||||
fi
|
|
||||||
|
|
||||||
(cd "$DIR/../" && RUSTFLAGS="-C target-cpu=x86-64-v3" cargo build --no-default-features "${additional_flags[@]}")
|
(cd "$DIR/../" && RUSTFLAGS="-C opt-level=0" cargo build --no-default-features)
|
||||||
valgrind --tool=callgrind --callgrind-out-file="$DIR/../callgrind.out" "$DIR/../target/${PROFILE}/parse" "${@}"
|
valgrind --tool=callgrind --callgrind-out-file="$DIR/../callgrind.out" "$DIR/../target/debug/parse" "${@}"
|
||||||
|
|
||||||
echo "You probably want to run:"
|
echo "You probably want to run:"
|
||||||
echo "callgrind_annotate --auto=yes '$DIR/../callgrind.out'"
|
echo "callgrind_annotate --auto=yes '$DIR/../callgrind.out'"
|
||||||
}
|
|
||||||
|
|
||||||
main "${@}"
|
|
||||||
|
@ -4,9 +4,10 @@ use nom::IResult;
|
|||||||
|
|
||||||
pub(crate) type Res<T, U> = IResult<T, U, CustomError<T>>;
|
pub(crate) type Res<T, U> = IResult<T, U, CustomError<T>>;
|
||||||
|
|
||||||
|
// TODO: MyError probably shouldn't be based on the same type as the input type since it's used exclusively with static strings right now.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum CustomError<I> {
|
pub enum CustomError<I> {
|
||||||
MyError(MyError<&'static str>),
|
MyError(MyError<I>),
|
||||||
Nom(I, ErrorKind),
|
Nom(I, ErrorKind),
|
||||||
IO(std::io::Error),
|
IO(std::io::Error),
|
||||||
}
|
}
|
||||||
@ -30,9 +31,3 @@ impl<I> From<std::io::Error> for CustomError<I> {
|
|||||||
CustomError::IO(value)
|
CustomError::IO(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<I> From<&'static str> for CustomError<I> {
|
|
||||||
fn from(value: &'static str) -> Self {
|
|
||||||
CustomError::MyError(MyError(value))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#![feature(round_char_boundary)]
|
||||||
#![feature(exit_status_error)]
|
#![feature(exit_status_error)]
|
||||||
#![feature(trait_alias)]
|
#![feature(trait_alias)]
|
||||||
// TODO: #![warn(missing_docs)]
|
// TODO: #![warn(missing_docs)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user