Skip to content

define cconvert for DenseStringViewAndSub instead of only the Sub #7

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

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Jun 16, 2022

Otherwise, a materialized String from the StringView will be created in any ccall (which kind of kills the point of the package since most things end up in a ccall). For example:

julia> sv = StringView("foo");

julia> @btime $sv == "foo" # allocations :(
  53.708 ns (2 allocations: 88 bytes)
true

After:

julia> @btime $sv == "foo" # no allocations :)
  5.037 ns (0 allocations: 0 bytes)
true

All the other stuff above is defined for DenseStringViewAndSub so is it just a typo that this wasn't the case for cconvert as well?

@KristofferC
Copy link
Member Author

cc @stevengj

@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2022

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 75.05%. Comparing base (7c7f0b6) to head (43eb0c4).
Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
src/StringViews.jl 50.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #7   +/-   ##
=======================================
  Coverage   75.05%   75.05%           
=======================================
  Files           6        6           
  Lines         417      417           
=======================================
  Hits          313      313           
  Misses        104      104           
Flag Coverage Δ
unittests 75.05% <50.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KristofferC KristofferC merged commit 716735e into JuliaStrings:main Jun 17, 2022
@KristofferC KristofferC deleted the kc/cconvert_stringview branch June 18, 2022 10:44
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.

2 participants