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

improve performance of ByteData #16512

Closed
DartBot opened this issue Feb 3, 2014 · 4 comments
Closed

improve performance of ByteData #16512

DartBot opened this issue Feb 3, 2014 · 4 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-typed-data type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Feb 3, 2014

This issue was originally filed by @tatumizer


processor Core i7 2.7Ghz, Windows 64
single call to ByteData.setInt16 takes 57 nanoseconds, same with setInt32 - 85 nanoseconds.
For comparison, setting element a[i] in Unit16List takes 1.24 nanoseconds (roughly the same as Unit32List) - including loop overhead, that is, operation itself is about 1-2 cycles, which is expected.
You are certainly aware of this, I'm opening a bug mostly for tracking purposes.

@DartBot
Copy link
Author

DartBot commented Feb 4, 2014

This comment was originally written by @tatumizer


BTW, see http://lemire.me/blog/archives/2012/05/31/data-alignment-for-speed-myth-or-reality/
It seems alignment doesn't matter for modern processors.
So setInt16 as well as setInt32 should take 1 cycle (inlined), regardless of alignment (assuming little-endian encoding). Another cycle might be needed (or not) to check index range.

@lrhn
Copy link
Member

lrhn commented Feb 4, 2014

Removed Type-Defect label.
Added Type-Enhancement, Library-TypedData, Area-Library, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jan 30, 2015

This comment was originally written by @tatumizer


Please close the issue. It's done already.

@floitschG
Copy link
Contributor

thanks.


Added AssumedStale label.

@DartBot DartBot added Type-Enhancement library-typed-data area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant labels Jan 30, 2015
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-typed-data type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants