Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jul 1, 2024
1 parent 721606b commit 523bf78
Show file tree
Hide file tree
Showing 17 changed files with 699 additions and 70 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ jobs:
# Replace branch in README.md link definitions for badges with the new version:
find . -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/branch([=:])[^ ]+/branch\1v${NEW_VERSION}/g"
# Rewrite CHANGELOG.md to replace "Unreleased" with the new version:
sed -Ei "s/Unreleased/${NEW_VERSION}/g" CHANGELOG.md
sed -Ei "s/unreleased/v${NEW_VERSION}/g" CHANGELOG.md
# Create a new commit and tag:
git add package.json README.md
git commit -m "Release v${NEW_VERSION}"
Expand Down
130 changes: 129 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,132 @@

> Package changelog.
See [GitHub Releases](https://github.com/stdlib-js/array-pool/releases) for the changelog.
<section class="release" id="unreleased">

## Unreleased (2024-07-01)

<section class="features">

### Features

- [`88cece6`](https://github.com/stdlib-js/stdlib/commit/88cece679d728150847dc2b5c957b395bffe7d90) - add boolean dtype support to `array/pool` [(#2486)](https://github.com/stdlib-js/stdlib/pull/2486)

</section>

<!-- /.features -->

<section class="commits">

### Commits

<details>

- [`88cece6`](https://github.com/stdlib-js/stdlib/commit/88cece679d728150847dc2b5c957b395bffe7d90) - **feat:** add boolean dtype support to `array/pool` [(#2486)](https://github.com/stdlib-js/stdlib/pull/2486) _(by Jaysukh Makvana, Athan Reines)_
- [`75d4f83`](https://github.com/stdlib-js/stdlib/commit/75d4f83cb85610d23a04dc21a03f8075f6d3665f) - **refactor:** update require and include paths _(by Athan Reines)_

</details>

</section>

<!-- /.commits -->

<section class="contributors">

### Contributors

A total of 2 people contributed to this release. Thank you to the following contributors:

- Athan Reines
- Jaysukh Makvana

</section>

<!-- /.contributors -->

</section>

<!-- /.release -->

<section class="release" id="v0.2.1">

## 0.2.1 (2024-02-25)

<section class="features">

### Features

- [`e25b23b`](https://github.com/stdlib-js/stdlib/commit/e25b23b917ee6e387722db7192d22e4a70222da0) - rename type definitions for array and ndarray data types
- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017) - update minimum TypeScript version

</section>

<!-- /.features -->

<section class="bug-fixes">

### Bug Fixes

- [`80e9e9a`](https://github.com/stdlib-js/stdlib/commit/80e9e9a3874cf073bf2c2aea9b06e7a8973c676c) - update accessor resolution

</section>

<!-- /.bug-fixes -->

<section class="breaking-changes">

### BREAKING CHANGES

- [`e25b23b`](https://github.com/stdlib-js/stdlib/commit/e25b23b917ee6e387722db7192d22e4a70222da0): rename type definitions for array and ndarray data types
- [`e25b23b`](https://github.com/stdlib-js/stdlib/commit/e25b23b917ee6e387722db7192d22e4a70222da0): rename type definitions for array and ndarray data types

- In order to migrate, users should update their implementations to
use the latest naming conventions. The affected type definitions
are aliases for individual data type strings, so their should be
no behavioral changes.

- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017): update minimum TypeScript version
- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017): update minimum TypeScript version to 4.1

- To migrate, users should upgrade their TypeScript version to at least version 4.1.

</section>

<!-- /.breaking-changes -->

<section class="commits">

### Commits

<details>

- [`80e9e9a`](https://github.com/stdlib-js/stdlib/commit/80e9e9a3874cf073bf2c2aea9b06e7a8973c676c) - **fix:** update accessor resolution _(by Athan Reines)_
- [`b9a7a49`](https://github.com/stdlib-js/stdlib/commit/b9a7a492fe0999423a025151f00268281c25f4f5) - **refactor:** query default dtype _(by Athan Reines)_
- [`e25b23b`](https://github.com/stdlib-js/stdlib/commit/e25b23b917ee6e387722db7192d22e4a70222da0) - **feat:** rename type definitions for array and ndarray data types _(by Athan Reines)_
- [`bcb4079`](https://github.com/stdlib-js/stdlib/commit/bcb4079adf3e31d33d28db5dff21558c9e6bd5be) - **build:** remove and replace tslint directives _(by Philipp Burckhardt)_
- [`9502ed2`](https://github.com/stdlib-js/stdlib/commit/9502ed27e2853e312c556a48bdd7775095e66709) - **build:** replace tslint directive with eslint equivalent _(by Philipp Burckhardt)_
- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017) - **feat:** update minimum TypeScript version _(by Philipp Burckhardt)_
- [`43b454e`](https://github.com/stdlib-js/stdlib/commit/43b454ef52b9aba92242d95e05d82c3952715368) - **refactor:** avoid usage of utils/copy _(by Philipp Burckhardt)_

</details>

</section>

<!-- /.commits -->

<section class="contributors">

### Contributors

A total of 2 people contributed to this release. Thank you to the following contributors:

- Athan Reines
- Philipp Burckhardt

</section>

<!-- /.contributors -->

</section>

<!-- /.release -->

3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Pushpendra Chandravanshi <[email protected]>
Raunak Kumar Gupta <[email protected]>
Rejoan Sardar <[email protected]>
Ricky Reusser <[email protected]>
Ridam Garg <[email protected]>
Robert Gislason <[email protected]>
Roman Stetsyk <[email protected]>
Rutam <[email protected]>
Expand All @@ -75,7 +76,7 @@ Shraddheya Shendre <[email protected]>
Shubh Mehta <[email protected]>
Shubham Mishra <[email protected]>
Sivam Das <[email protected]>
Snehil Shah <[email protected].com>
Snehil Shah <snehilshah.989@gmail.com>
Soumajit Chatterjee <[email protected]>
Spandan Barve <[email protected]>
Stephannie Jiménez Gacha <[email protected]>
Expand Down
28 changes: 8 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@license Apache-2.0
Copyright (c) 2018 The Stdlib Authors.
Copyright (c) 2024 The Stdlib Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -29,7 +29,7 @@ limitations under the License.
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
</details>

# Typed Array Pool
# typedarraypool

[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->

Expand Down Expand Up @@ -75,7 +75,7 @@ var typedarraypool = require( '@stdlib/array-pool' );

#### typedarraypool( \[dtype] )

Returns an **uninitialized** [typed array][mdn-typed-array] having a specified data type `dtype`.
Returns an **uninitialized** [typed array][mdn-typed-array] having a specified [data type][@stdlib/array/typed-dtypes] `dtype`.

```javascript
var arr = typedarraypool();
Expand All @@ -86,21 +86,7 @@ var arr = typedarraypool();
typedarraypool.free( arr );
```

The function recognizes the following data types:

- `float64`: double-precision floating-point numbers (IEEE 754)
- `float32`: single-precision floating-point numbers (IEEE 754)
- `complex128`: double-precision complex floating-point numbers
- `complex64`: single-precision complex floating-point numbers
- `int32`: 32-bit two's complement signed integers
- `uint32`: 32-bit unsigned integers
- `int16`: 16-bit two's complement signed integers
- `uint16`: 16-bit unsigned integers
- `int8`: 8-bit two's complement signed integers
- `uint8`: 8-bit unsigned integers
- `uint8c`: 8-bit unsigned integers clamped to `0-255`

By default, the output [typed array][mdn-typed-array] is `float64`. To specify an alternative data type, set the `dtype` parameter.
By default, the output [typed array][mdn-typed-array] is `float64`. To specify an alternative [data type][@stdlib/array/typed-dtypes], set the `dtype` parameter.

```javascript
var arr = typedarraypool( 'int32' );
Expand Down Expand Up @@ -168,7 +154,7 @@ typedarraypool.free( arr2 );

#### typedarraypool.malloc( \[dtype] )

Returns an **uninitialized** [typed array][mdn-typed-array] having a specified data type `dtype`.
Returns an **uninitialized** [typed array][mdn-typed-array] having a specified [data type][@stdlib/array/typed-dtypes] `dtype`.

```javascript
var arr1 = typedarraypool.malloc();
Expand Down Expand Up @@ -240,7 +226,7 @@ typedarraypool.free( arr2 );

#### typedarraypool.calloc( \[dtype] )

Returns a **zero-initialized** [typed array][mdn-typed-array] having a specified data type `dtype`.
Returns a **zero-initialized** [typed array][mdn-typed-array] having a specified [data type][@stdlib/array/typed-dtypes] `dtype`.

```javascript
var arr1 = typedarraypool.calloc();
Expand Down Expand Up @@ -562,6 +548,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].

[mdn-arraybuffer]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer

[@stdlib/array/typed-dtypes]: https://github.com/stdlib-js/array-typed-dtypes

<!-- <related-links> -->

[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed
Expand Down
21 changes: 20 additions & 1 deletion benchmark/benchmark.calloc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,6 +23,7 @@
var bench = require( '@stdlib/bench-harness' );
var isTypedArray = require( '@stdlib/assert-is-typed-array' );
var isComplexTypedArray = require( '@stdlib/assert-is-complex-typed-array' );
var isBooleanArray = require( '@stdlib/assert-is-booleanarray' );
var pkg = require( './../package.json' ).name;
var typedarray = require( './../lib' );

Expand Down Expand Up @@ -209,6 +210,24 @@ bench( pkg+':calloc:dtype=uint8c', function benchmark( b ) {
b.end();
});

bench( pkg+':calloc:dtype=bool', function benchmark( b ) {
var arr;
var i;
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = typedarray.calloc( 0, 'bool' );
if ( arr.length !== 0 ) {
b.fail( 'should have length 0' );
}
}
b.toc();
if ( !isBooleanArray( arr ) ) {
b.fail( 'should return a boolean array' );
}
b.pass( 'benchmark finished' );
b.end();
});

bench( pkg+':calloc:dtype=complex64', function benchmark( b ) {
var arr;
var i;
Expand Down
21 changes: 20 additions & 1 deletion benchmark/benchmark.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,6 +23,7 @@
var bench = require( '@stdlib/bench-harness' );
var isTypedArray = require( '@stdlib/assert-is-typed-array' );
var isComplexTypedArray = require( '@stdlib/assert-is-complex-typed-array' );
var isBooleanArray = require('@stdlib/assert-is-booleanarray');
var pkg = require( './../package.json' ).name;
var typedarray = require( './../lib' );

Expand Down Expand Up @@ -209,6 +210,24 @@ bench( pkg+':dtype=uint8c', function benchmark( b ) {
b.end();
});

bench( pkg+':dtype=bool', function benchmark( b ) {
var arr;
var i;
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = typedarray( 0, 'bool' );
if ( arr.length !== 0 ) {
b.fail( 'should have length 0' );
}
}
b.toc();
if ( !isBooleanArray( arr ) ) {
b.fail( 'should return a boolean array' );
}
b.pass( 'benchmark finished' );
b.end();
});

bench( pkg+':dtype=complex64', function benchmark( b ) {
var arr;
var i;
Expand Down
Loading

0 comments on commit 523bf78

Please sign in to comment.