Revision 0535d452dd426ba62d6d312766906ddd1230c7eb authored by Andrey Zhavoronkov on 02 November 2023, 15:59:39 UTC, committed by GitHub on 02 November 2023, 15:59:39 UTC
This PR speeds up the preparation of chunks by: 1. loading images once instead of twice in each writer, 2. as well as by allowing simultaneous preparation of more than 1 chunk using multithreading. This allows to reduce the time for preparation of chunks for 4895 images from 0:04:36 to 0:01:20 in case of preparation of 3 chunks in parallel and 0:02:46 in case of 1 chunk in my environment. Co-authored-by: Maria Khrustaleva <maya17grd@gmail.com>
1 parent 1f8d5d3
webpack.config.js
// Copyright (C) 2021-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const BundleDeclarationsWebpackPlugin = require('bundle-declarations-webpack-plugin');
const styleLoaders = [
'style-loader',
{
loader: 'css-loader',
options: {
importLoaders: 2,
},
},
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
[
'postcss-preset-env', {},
],
],
},
},
},
'sass-loader',
];
module.exports = {
target: 'web',
mode: 'production',
devtool: 'source-map',
entry: {
'cvat-canvas3d': './src/typescript/canvas3d.ts',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].[contenthash].js',
library: 'canvas3d',
libraryTarget: 'window',
},
resolve: {
extensions: ['.ts', '.js', '.json'],
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
plugins: ['@babel/plugin-proposal-class-properties'],
presets: ['@babel/preset-env', '@babel/typescript'],
sourceType: 'unambiguous',
},
},
},
{
test: /\.scss$/,
exclude: /node_modules/,
use: styleLoaders,
},
],
},
plugins: [
new BundleDeclarationsWebpackPlugin({
outFile: "declaration/src/cvat-canvas.d.ts",
}),
],
};
Computing file changes ...