Comments (6)
It seems to me that we should use arrays that are definitely unboxed (so that we can load them by doing a simple memcpy), and probably storable (in case people want access to the underlying ptrs) in case people want to pass pointers to C functions through FFI.
We can add instances to IsValue for Data.Vector so that it is still possible to easily unmarshal to a normal boxed haskell vector if the user prefers that.
This approach would avoid tons of extra unmarshalling in cases where performance may be a concern.
from haskell-dbus.
Is there a use case for DBus where performance is a concern? I honestly don't know, my understanding is DBus used for semantically rich, but low-data interactions.
Said that, deserializing data directly to vector instead of intermediate list looks like an obvious change.
from haskell-dbus.
@rblaze DBus is used to communicate things like full menus which will contain several images. Image data can be large enough that it doesnt make sense to store it in lists, and doing so can significantly slow things down, so yes, I think there are use cases where performance is a concern.
from haskell-dbus.
Yes, deserializing without intermediate lists is good in any case. I just wonder if it worth playing with memcpy-like constructs, sacrificing readability and safety.
from haskell-dbus.
I took another look at this. To significantly improve performance with large byte arrays I'll need to change exposed types and marshaling code.
In this particular place, the performance hit isn't that significant: it only copies pointers to the boxed values, not values themselves. But I'll update it to use direct vector creation anyway.
from haskell-dbus.
On the closer look, nothing I can do there. Marshaled DBus arrays do not provide item count, the only way to know how many elements are there is to read them until data are exhausted. And vectors need to know item count in advance.
from haskell-dbus.
Related Issues (20)
- Support multiple addresses for sessions HOT 6
- Package revisions HOT 3
- dbus depends on deprecated version of xml-conduit HOT 3
- Build error with ghc-8.10.1 HOT 10
- Auth failure on FreeBSD HOT 6
- dbus doesn't build with clang on OpenBSD HOT 3
- Handle missing DBUS_SESSION_BUS_ADDRESS HOT 7
- Remove // in the example? HOT 3
- matchAll instead of matchAny HOT 1
- Writing services? HOT 7
- Converting signal body to string? HOT 2
- Test failure with network 3.1.2.0 HOT 3
- Loosen bounds on Hackage HOT 2
- Build failures in dbus 1.0.0 to 1.2.2 with GHC 9.0.1 HOT 2
- Fails to compile with GHC 9.2.1
- `dbus` 1.2.23 no longer supports GHC 8 HOT 5
- Support for older GHCs HOT 1
- dbus XML parser fails to parse XML documents with namespace extensions HOT 13
- Feature Request: expose the dbus unique client name HOT 3
- Dependency bounds are too restrictive for ghc 9.6 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haskell-dbus.