Comments (3)
Being lazy in the base case, like the Prelude's take
is usually not very useful and hurts performance because other arguments can no longer be unboxed (because they might not be used). In other places in containers (e.g. Data.IntMap.lookup
) I believe being lazy in the base case costs as much as 10% performance.
I even wrote about it: http://johantibell.com/files/haskell-performance-patterns.html#(11) (and also elsewhere).
from containers.
@tibbe In the page you linked to, laziness in the base case prevents the Int
argument from being unboxed, which is obviously bad. In this case, laziness in the i<=0
case does not do this, so it's not clear to me whether it's bad or not. That said, I think we can probably both agree that the current implementation is the worst of both worlds. I don't mind following GHC's semantics (as described above), and I also don't mind switching to completely strict semantics for this.
from containers.
Fixed by aaf5408
from containers.
Related Issues (20)
- Symmetric difference for sets
- Incorrect order of Applicative actions in mergeA when using filterAMissing HOT 4
- `IntMap` `isProperSubmapOfBy` test failure HOT 4
- More accurate Set and Map size warnings HOT 3
- Complexity of IntMap-IntMap operations
- Is this repo up to date? HOT 7
- Consider maintaining the x.y.z.a versioning HOT 7
- Rewrite rules for IntMap: intersectionWithKey/mapWithKey HOT 8
- feat request: Add `popLeftWithValue` and `popWithValue` in `Data.Sequence` HOT 5
- Data.Graph: detect cycles utility functions HOT 2
- Data.Map.mergeWithKey doesn't match documentation
- Flag to introduce pedantic invariant checks? HOT 2
- Map.unionWith is over specialized and not consistent with intersectionWith HOT 10
- Add `flattenSCC1 : SCC vertex -> Data.List.NonEmpty.NonEmpty vertex` HOT 2
- Data.Map.Internal does not export insertMin HOT 1
- Repo: remove merged branches?
- Contribution guide outdated?
- Potential memory optimization for IntMap and IntSet HOT 8
- Errors when trying to generate a test coverage report HOT 10
- Full IntSets? HOT 5
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 containers.