File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -18,3 +18,9 @@ lazy_static = "1.5"
1818[profile .release ]
1919lto = true
2020codegen-units = 1
21+ strip = " symbols"
22+ panic = " abort"
23+
24+ # Specific profile for WASM builds
25+ [profile .release .package ."*" ]
26+ opt-level = " s"
Original file line number Diff line number Diff line change @@ -279,6 +279,7 @@ fn first_is_month(date_vec: &[String]) -> bool {
279279/// Validate day imputation value range
280280/// @noRd
281281#[ extendr]
282+ #[ no_mangle]
282283fn checkday ( day_impute : Robj ) -> Result < ( ) > {
283284 if day_impute. is_null ( ) || day_impute. len ( ) == 0 {
284285 return Ok ( ( ) ) ; // nothing to check
@@ -721,6 +722,7 @@ fn fix_date_native(
721722/// Analyze and fix date strings in a whole column of a DataFrame
722723/// @noRd
723724#[ extendr]
725+ #[ no_mangle]
724726fn fix_date_column (
725727 dates : Vec < String > ,
726728 day_impute : i32 ,
@@ -753,6 +755,7 @@ fn fix_date_column(
753755/// Main date fixing function - Rust implementation of .fix_date
754756/// @noRd
755757#[ extendr]
758+ #[ no_mangle]
756759fn fix_date (
757760 date : Robj ,
758761 day_impute : Option < i32 > ,
Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ cfg <- if (is_debug) "debug" else "release"
6363# there may be use cases later where this can be adapted or expanded
6464.target <- ifelse(is_wasm , paste0(" --target=" , webr_target ), " " )
6565
66- # add panic exports only for WASM builds via RUSTFLAGS
66+ # add panic exports and symbol optimization flags only for WASM builds via RUSTFLAGS
6767.panic_exports <- ifelse(
6868 is_wasm ,
69- " RUSTFLAGS=\" $RUSTFLAGS -C panic=abort\" " ,
69+ " RUSTFLAGS=\" $RUSTFLAGS -C panic=abort -C opt-level=s -C lto=fat -C codegen-units=1 -C strip=symbols \" " ,
7070 " "
7171)
7272
You can’t perform that action at this time.
0 commit comments