Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disallow sharing of memo table in IDLBuilder #210

Merged
merged 2 commits into from
Mar 19, 2021
Merged

Conversation

chenyan-dfinity
Copy link
Contributor

@chenyan-dfinity chenyan-dfinity commented Mar 19, 2021

We use a global memo table to map Rust type to Candid type. The same Rust type can map to a different but equivalent Candid type in different runs, due to memo match happen in different time/order. Unless we implement equivalence checking for candid types, we failed to identify these equivalent types in the type table.

The fix is easy: disallow sharing of memo tables across different encoding calls.

@chenyan-dfinity chenyan-dfinity merged commit fd841ed into master Mar 19, 2021
@chenyan-dfinity chenyan-dfinity deleted the fix-knot branch March 19, 2021 22:57
@github-actions
Copy link

Benchmark for b96661e

Click to view benchmark
Test PR Benchmark Master Benchmark %
Blob/&str 230.3±75.77µs 235.8±79.60µs -2.33%
Blob/ByteBuf 201.4±47.69µs 203.1±44.73µs -0.84%
Blob/Bytes 118.2±33.95µs 120.9±33.99µs -2.23%
Blob/String 313.8±88.98µs 312.0±86.14µs +0.58%
profiles/200 495.2±23.54µs 488.2±27.16µs +1.43%

@github-actions
Copy link

Benchmark for f18cc75

Click to view benchmark
Test PR Benchmark Master Benchmark %
Blob/&str 254.6±78.96µs 260.2±85.41µs -2.15%
Blob/ByteBuf 241.9±52.13µs 244.9±57.83µs -1.22%
Blob/Bytes 144.8±40.24µs 152.7±46.30µs -5.17%
Blob/String 340.6±85.82µs 351.8±86.98µs -3.18%
profiles/200 576.6±33.89µs 517.9±45.50µs +11.33%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant